It seems easy to define religion like your dictionary definition, in a region with overwhelmingly only Abrahamic faiths. But the etymology gives us some historical perspective. From Etymonline:
c. 1200, religioun, "state of life bound by monastic vows," also
"action or conduct indicating a belief in a divine power and reverence
for and desire to please it," from Old
French religion, relegion "piety, devotion; religious community," and
directly from Latin religio "respect for what
is sacred, reverence for the gods; conscientiousness, sense of right,
moral obligation; fear of the gods; divine service, religious
observance; a religion, a faith, a mode of worship, cult; sanctity,
holiness,".
This noun of action was derived by Cicero from relegere "go through
again" (in reading or in thought). Popular etymology among the later
ancients (Servius, Lactantius, Augustine) connects it with religare "to bind fast" (see
rely), via the notion of "place an obligation on," or "bond between
humans and gods." Another
possible origin is religiens "careful," opposite of negligens
And many traditions long called religions, primarily involve priests providing intercession with spirits: in Africa, the Caribbean (Haiti's state religion is Voodou), Northern Scandinavia & Russia (eg Sami), China (Wuism), and Tibet (Bon). Certainly fits the etymological meaning. These form one of the most widespread modes of religious practice. There have certainly been many attempts to call these 'proto religion', their practicioners seen as somehow not developed enough for 'real' religion, but we should consign that to the dustbin with the imperialism that generated it.
All the religions I can think of have a cosmology, a picture of how things came to be, but that cosmology may be given prominence and often referenced, or it may be incidental and only explain a few features of the local landscape. Especially since the arrival of science, saying having a cosmology of any kind is having religion, seems like hubris on behalf of the religious.
(I would instead relate cosmology to worldview or paradigm, as discussed here: Which philosophers and philosophies discuss "worldview epistemologies"?).
Foundational sociologist Durkheim broke with the history of using Abrahamic practices as the template for what religion is, in his 1912 book 'The Elementary Forms of Religious Life'. He pictured religion as the binding together of social groups by their enacting shared attitudes to sacred things; that is, towards what is put 'beyond question'. Sacred groves, altars, the prescriptions of a shaman, or books, can be understood like this, and behaviour towards them related to how cohesive the 'church' or congregation associated with them is.
Nationalism came to prominence above all other political modes, in impacting wars in the 20th Century. I would look to the prototype theory of truth to understand nationalism: we look to the British and other colonial nations, and above all to Nazi Germany, to see how the state and national culture were raised to special prominence in certain places, and we return to those whenever nationalism is discussed. Perhaps now also the USA.

I would suggest rather than all nationalism being like religion, there are traits which can make a given era or culture of nationalism more or less like religions. Serious penalties for apostasy, and heterodoxy, have often been used as tools to enforce the binding power of sharing values, and the power structures associated with them. A nationalism like Nazi Germany's that used those tools, seems more focused on a church-like role. North Korea has a similar focus on cults of personalities, and uses those tools.
The USA certainly cultivates a nationalist fervor, with a daily pledges of allegiance in schools. But values around free speech, and defending the right to express dissent, are part of what is celebrated.
Similar with elevating the Magna Carta and the habeus corpus rights in British nationalism. It us used by nationalists, just like looking back on glory days or great battles, to identify some special national qualities impact or destiny. But, it facilitates state accountability, clarity about the rule of law, and division of powers.
So I would say nationalism can be used as a religion, can be practiced religiously - that is, as a primary source of social cohesion, focused on the kind and degree of what is held sacred or unquestionable. But that need not be so, and is not for all examples of nationalism.
In this traits model we can also look at different religions as more or less religious, in relation to how tightly bound the congregation is in what they hold sacred (vs by things like culture or cosmology alone), and compare say different strands of Christianity in their religiousness.