It seems to me that there were societies that had been quite nationalistic -- and been highly conscious of their nationhood -- even in Antiquity. So why can't we recognize this and cease our seeming relegation of references to nationalism and nationhood solely to the last 200-300 years?
Not exactly my field of expertise, but I can provide some thoughts to get a conversation going. This is an interesting and valid question since we do apply several important concepts on periods when nobody conceptualized things in exactly that way (though, spoilers: I don't think nation should be applied retroactively).
Historians like Eric Hobsbawm (Nations and Nationalism Since 1780: Programme, Myth, Reality) have pointed out that the term nation being used in anything close to its current meaning is a very recent phenomenon.
Group identities, of one sort or another, have of course existed since time immemorial. In the case of Ancient Rome you have many ways of forging identity which overlapped and sometimes overwrote each other. Tribes were central to early Rome, but as Rome expanded and incorporated new territories and peoples, the tribal identities became less what we'd call ethnic and more symbolic. As the Roman Empire expanded even further, and with it citizenship, there was yet another shift in what it meant to be Roman.
Part of the effectiveness of the Roman Empire was tied into the fact that it did not impose Romanization on locals nor did it immediately disrupt their way of life. Rather, Rome would expand and co-opt local elites while introducing elements of Roman civilization (which themselves were gathered from other civilization, in particular Ancient Greece) which slowly influenced local customs. You certainly saw the introduction of Roman colonies, especially ex-soldiers who were settled here and there throughout the empire, but ethnic assimilation was never the cornerstone of the empire.
It's far less a field of expertise for me, but in Medieval states, while culture and group identity were important, there wasn't a nationalistic call to be a single people or nation. Multiple peoples could be the subjects of a single monarch. That didn't mean that the ruled didn't care about the group identity of the ruler, especially if it was a new ruler who had cruelly subjugated them in a recent war. It just meant that ruler and ruled didn't necessarily have to come from the same ethnic and linguistic groups.
In the late modern era, however, you start seeing this idea that nations exist. That nationalities were coherent group identities which stretched back in time even to when a given "people" would not have necessarily seen themselves to be part of a single identity.
These national identities which were being created at this time saw peoples as being unified by ties we'd today perhaps call "ethnicity", together with a language, a culture, and a regional ancestral home.
These nationalistic projects could be tied to plans to unify a region (such as in Germany and Italy). In other words, the creation of a national identity among peoples who might not even see themselves as belonging to a single overarching "group" was often a theoretical justification for practical political projects.
The idea that nationhood stretches back before late modernity is part of the point. It's a product of the nationalist project. To paraphrase a phrase, "the greatest trick nationalism ever pulled was convincing the world it always existed." These nationalist movements and projects for nation-states tried to build these coherent histories of X or Y people from antiquity to the present, even (or perhaps especially) when in ancient times these national identities would have been foreign, especially to everyday people.
French identity was slowly forged over centuries, in no small part because a the French state slowly forged it both through intentional policies and the natural product of trade, social networks, military mobilizations, and other kinds of interconnections.
Nationalism as a project had the benefit, if successful, of making regional identities feel part and parcel of a broader identity, and therefore more loyal and less likely to engage in separatism. Examples of failed national projects about.
A great example of this is Spain. The term Spain comes from the Roman term for much of Iberia, Hispania. While Spanish rulers in the modern era tried to posture as the rulers of 'las Españas', they failed to create a single coherent national identity. The Basque are the most obvious case, but they are linguistically and culturally distinct from the rest of the peoples of Iberia. But what about Catalonia? The Catalán independence movement has been an issue on and off for centuries. The "Catholic Kings" united Castile and Aragon, but they failed to fully integrate these subjects into a single unitary political and cultural project. Catalonia has long been ruled by special laws and customs, continues to preserve its own language (as opposed to many regional languages in France which passed out of use), and has continued to exist as an identity into the present.
Another example, though different in many ways, is the UK. The English attempted to create a unifying British identity under which the regional cultures of the British isles (under the control of England of course) could unite. This was a failure in Ireland, which was in all but name a colony for much of the modern era, and judging by the recurrence of the Scottish independence movement even that region was not fully and successfully integrated under this new identity.
Let us again contrast this with France, which successfully incorporated territories which had previously belonged to Burgundy and Provence.
Nationalism also made far more sense in an era in which politics was slowly expanding political participation, whether elites in that country wanted to or not. If you needed to incorporate hundreds of thousands if not millions into politics, you needed to create a coherent group identity which has the potential unifying them in the pursuit of a greater good beyond regional identity and interest (at least in theory).
Nationalism is a group identity which incorporates language, a specific homeland, and (usually) some kind of blood ties, and is a specific product of the 19th century. Local identities were far more important in a pre-modern world and these were connected more to being subjects of the same monarch and were not tied to nation-states. The focus on ethnicity was less important in pre-modern times than confessional allegiances (as seen in the cases of the successive expulsions of the Jews and later the Moriscos Spain). Local customs and identities existed and might be defended rigorously (such as the Kingdom of Aragon, which contains modern day Catalonia) but these group identities were not articulated in the same ways as nationalism (especially ethnic nationalism) was.
Nationalism is just a word. In the end, somebody can try to rework it so that it encompasses a really wide range of group identities throughout time, but honestly I think that effort would be better spent creating good specific terms for each context instead.
In addition to the already mentioned book by Hobsbawm you can also check out Benedict Anderson's Imagined Communities.