WW1 kicked off due to a royal getting murdered in broad daylight which triggered a cascade of alliances. Nationality had nothing to do with it.
WW2 kicked off due to the victors of WW1 raping Germany so bad they had nothing but nationalism to hold on to. American nationalism also initially wanted nothing to do with WW2, begrudgingly started helping behind the curtains once the UK became endangered and then went "Yeah, fuck this noise. Y'all will be infamous." once Japan started playing funny tunes.
Nationalism is both good and bad, namely too much of it is a bad thing like everything else in the world while too little of it is also a bad thing akin to malnourishment.