The Empire of the Sun refers to the Japanese Empire (Note their white flag with the red sun on it). Statements in the book or movie are on the Japanese empire as well as other major powers in the war. Remember that the three big nationalist Axis powers in WWII were Japan, Italy and Germany. Also remember that in addition to Japanese camps which held British, American, civilians (like the one Jim and Basie find themselves in), there were camps in the United States that held civilians of Japanese descent. Although the movie (I haven't read the book) focuses on the coming of age of Jim, a British boy, in a Japanese camp, this is also about American imperialism. Jim sees a flash near the end which is the bomb dropped on Nagasaki; so, this is about the battle of empires. The mid 20th century marks the final stages of the decline of the British empire.
The British detaineesat the camp survive as any makeshift society would. If your question is about how they survived, I wouldn't say that imperialism or nationalism is what helped them. Jim essentially becomes a trader with a relatively vast network. This is how he survives. Being such a trader, the middle man, this marks his coming of age/loss of innocence, and this is a stretch: his use of economic expansion (within the camp) which is characteristic of an expanding empire, but not a characteristic of a nationalist country. As far as nationalism goes, Jim actually finds honor and awe in the Japanese kamikaze pilots. That is the kind of nationalism he most admires. Jim eventually feels a familiarity with the war and the camp, he even forgets what his parents look like. His survival is not because he is tied to his past or because he has any allegiance to the British empire. A detainee at an internment camp probably relinquishes any ideas about imperialism and nationalism in order to survive. There is some sense of community among those in the camp, maybe specifically amongst the British, and even though they all depend upon each other in certain ways, it is everyone for him/herself.