I suppose those Battle Royale or kill count games where the enemy are the enemy just because, could be seen as military war games or exercise - practice for 'the real thing', which could be a WW2 simulator, for example.
The only game I'm in any way familiar with (I've played occasionally, but follow online community interactions, as I find it - perhaps ironically - a safe and manageable insight into how people relate to one another, social changes and commercial products, a kind of miniature observatory) is World of Warcraft.
It's occasionally a fascinating model of real life phenomena (such as trade via the online auction house, or the famous 'corrupted blood' incident which helped epidemiologists model for Covid), but in terms of the actual gameplay, it does tend towards 'rival factions putting aside differences to counter common threat identified as classically destructive and malevolent force', and there are plenty of instances of 'helping defenceless villagers against invading forces' as well. It's essentially the uncomplicated moral universe of Lord of the Rings, and as such ties into that primeval mythological need for 'good v evil' narrative, and the psychological validation of 'my small part in the struggle'.