Connecting different Pokemon games

Is it possible to connect Sun and Moon together or is it only just one version of the game, say I am running moon and my friend sun, if he or I make a room, can we play together.

ofc u can play together if you are in the same room in the Multiplayer Tab on the emu