Yes, you can play Minecraft with your friends on Xbox. Both you and your friends will need Minecraft Bedrock edition. You could either get yourself a Minecraft hosting or play over Realms.