To sum up nations warring with each other as 'nationalism' is just simplifying it to such an extreme that it's silly.
There's a common theme in WW1 and WW2, and it is that both World Wars were started by
Empires, or supra-national structures, which strived for power beyond the limits of what a common national structure could offer (a single land ruled by a single people).
World War 1 was started by the
Austro-Hungarian Empire invading Serbia, to suppress national sentiments, which activated a complex military pact between
Empires, the British Empire, the German Empire, the Russian Czardom, etc. all of which held colonies and oppressed foreign peoples.
To condemn WW1 as a result of nationalism, is to say that the nationalists who rebelled against an aristocracy which did not democratically represent them, were wrong, and that the monarchs were correct in attempting to violently suppress these sentiments. I suppose these same people would perhaps enjoy being ruled by a tyrannical, foreign king, then, unelected yet governing with absolute power.
Hitler spoke freely of cultivating Nazi Germany in the mold of what he saw as the American and British Empires, a third "Reich", requiring a genocide of peoples in the East, as the Americans and British had genocided natives and Indians, to extend their own rule and available resources. He also believed that the unification of Europe into a single "Germanic construct" was in Europe's best interests. He saw the invasion of the East as a means of restoring this Germanic order, which he believed to have been broken when the German czars and nobles of Russia had been driven off by the population, with the heads of many European states no longer representing ancient Germanic blood-lines.
And what was USSR in Stalin's hands, but an Empire which forcefully attempted to subjugate other people under its rule, while pretending that it was for their own good? Before Nazi invasions, Stalin had already been plotting the seizing of lands in East Europe and Asia. If it were not for Nazis, then he would have certainly started WW2 by himself. And it would be the Communist threat that we would still be speaking of, rather than a fascist threat. The arms race which culminated into WW2 was not started by Hitler, but rather by Stalin, with the Nazis benefiting from the terror caused by Stalin's reign, in order to seize power in Germany.
Most wars have always, and will continue to be provoked by supra-national structures, instead of national ones. Only a fool would think that the Swedes, or the Italians, or the Greeks, or the Poles, would start bickering amongst one another, unless one party decides that they no longer wish to remain a nation, but rather a construct which resides above the nation, with a claim for borders extending beyond their natural ones. There is absolutely no need for anybody to begin an imperial conquest unless they are brain-washed into it.
Right now, it is not the nationalists speaking with grandeur about residing next to Jupiter as a divine being, or restoring Europe to Roman glory, or bringing the US, Russia and China to heel under Europe's might, with a unified army. It is Macron and his like-minded EU goons, who speak that sort of language, openly amongst themselves in private, and increasingly openly even in public.
If there is any threat to peace and stability, it is due to such arrogance, delusion and detachedness from reality.