To be sure, nationalism is a dynamic concept that doesn’t lend itself to universal definition. Orwell influentially described it as identifying with a single nation or unit and recognizing no duty except the nation’s advancement, whereas some modern writers have conceived nationalism (at least of the American variety) more restrictively as a benign, “democratic” ethos defined primarily by loyalty to one’s country above all else.
Despite any descriptive variation, though, the irreducible minimum in any conception of nationalism is abrogation of the individual as the relevant unit of political power. Absent that feature, the term is incoherent. The sine qua non of nationalism is the idea that the nation is supreme, and national supremacy doesn’t admit exceptions in the name of individual liberty. So to endorse nationalism, even for purportedly benevolent purposes, is to accept the idea that the citizen exists to serve the nation rather than the reverse.
The same goes for socialism. The two doctrines employ distinct language and imagery in expressing their respective missions — broadly, “public before self” versus “country before self” — but the basic feature of both is the use of centralized power at the expense of individual freedom to achieve an ill-defined and necessarily pliable common good. Both are, in other words, just rudimentary variants of authoritarianism.