While mass literacy and industrialization etc. are ingredients of nationalism, I don't agree that they have to lead to nationalism. People can possess other identities besides loyalty to a country/state - for example, loyalty to a religious whole, loyalty to a class, loyalty to a sub-region, etc.
Identification with the nation-state wasn't inevitable - even if it was perhaps the most likely, given the importance of nation-states and the frequency of European wars. Replacements would require pretty large PoDs, though - for a 'Christian-ism' to appear I guess first and foremost the reformation has to go, and for 'class-ism' to come first then a more vigorous industrialization has to emerge, and socialism also has to have greater resonance amongst the people than OTL.
The most likely alternative, actually, would probably be for people to identify with a state or a ruling house, not a 'nation'. Things like Habsburg-ism, Ottoman-ism, etc. This could happen if more European states were polyglot entities like the Habsburg Empire and you had a couple more 'Enlightened' monarchs around who were willing to harness the power of the people for military purposes.