You can create a JBoss cluster running in domain mode to replicate your HTTP sessions. You can either use a UDP or a TCP based cluster and deploy a clustered web application to enable session replication.
Can you please confirm which version of JBoss you are using.
Please refer to https://docs.wildfly.org/14/High_Availability_Guide.html for detailed informatin on creating a wildfly cluster.
I have already managed to configure a JBoss Domain to perform the session replication between nodes members of a same group, both by UDP and TCP, my question is whether it is possible to perform such a procedure between members of different groups controlled by different domains.
I am using JBoss EAP 6.4
Yes, you can do that. WildFly/EAP domains are just about managing the lifecycle of a set of servers and keeping their configurations consistent. The domain doesn't do anything to restrict the behavior of the services in those servers. In this case the relevant services are those related to web session clustering, so this means the domain doesn't try and restrict membership in those clusters to servers under one domain.
So long as the two server groups in your two domains have consistent configuration, particularly of the jgroups and infinispan subsystems, then the servers from both groups should be able to form a single JGroups cluster.