No the nation state was always the genesis of ethnic tribes. It was subverted to create economic pyramid schemes in the west.
Discussion
Tribes predate nation states by several hundred thousand years.
The modern nation state is a fairly recent invention. But to the point, yes, seems to me it only ever worked because people felt as a tribe under its banner, along with shared values, ways of seeing the world, common goals, etc.
Most of that seems to go away when multiple tribes from incompatible places each with competing values are artificially put together under that same single banner.
If at least it's organic and the rate is throttled and the newcomers are vetoed (coming to add value and not to leech, compatible cultural values etc) then it's probably find. But gazillions unvettoed coming to overload an already fragile system, from cultures with incompatible values, who largely have no wish to integrate with the broader culture, then yeah.. different story.
The nation state only functions as a fiction. Fiction only works by controlling information and communication. What we describe as Western culture is the melange of all these things.
Too many immigrants with a different culture break the fiction of the state. People stop believing in it and at the rate at which their belief ends, the nation state ends.
A unified nation state with one language, one culture, one religion and a self-image as one people is a very recent historical development.
The normal state was plurality in all these aspects, because nation states were usually forced combinations of different peoples and tribes.
So it is the other way around. It is not peoples and tribes that infiltrate the state, the state infiltrated, mixed and ultimately destroyed peoples and tribes.