My friend has Pokemon Sun and I'm most likely gonna get Moon, would we be able to trade, battle/interact with each other with different variations of the game?
Yes - Games within the same generation can trade with one another:
- Pokemon X can trade with Pokemon Y
- Pokemon Sun can trade with Pokemon Moon
Do note that Pokemon X/Y (Generation 6) cannot trade directly with Pokemon Sun/Moon (Generation 7). It is possible to transfer Pokemon from X/Y up to Sun/Moon, but this is a one-way transfer, not a trade.