Nationalism and divine mission
Nationalism can be based on religion as when a nation is supposed to be a vehicle of God's will. In the Old Testament, Israel was guided by divine providence even if it failed at least occasionally to live up to its mission. In this type of case nationalism cannot be a form of non-theistic religion.
This is true only on the assumption that nationalism stretches far back into history. There is an influential school of thought according to which nationalism and the nation are strictly modern phenomena:
Nationalism is "modern" because it stresses the individual's search for identity with strangers in an
impersonal world, a world no longer animated by corporate identities. All
nationalisms imply a principle of identity based on impersonal ties, remote
ties, vicarious ties-all of which are mediated by a set of common symbols
embedded in a certain pattern of communication. (Ernst B. Haas, International Organization, Vol. 40, No. 3 (Summer, 1986), pp. 707-744: 709.)
The conditions described here do not readily fit pre-modern societies.
Nationalism as civil religion
This is, I think, rather more what you are interested in:
Nationalism is ... a civil religion, often in conflict with but occasionally
drawing strength from real religions. That civil religion contains a set of core
values that, whether for objectivist or subjectivist reasons, come to be accepted by the population of a state; they become the definers of selfhood. In
successful nations they remain in that role until challenged by the next
source of tension; no civil religion is graven in stone. As long as the core
values provide the framework for social action, people know what to expect
of their fellows, understand and respect authority, are secure in their views
of the scheme of collective life. (Ernst B. Haas, International Organization, Vol. 40, No. 3 (Summer, 1986), pp. 707-744: 709.)