Nationalism isn't always synonymous with nations. Writers such as George Orwell have attacked nationalism as aggressive and imperialistic while asserting the benefits of patriotism: love of one's country without wishing it to dominate all others.
Others reject the view that nationalism is aggressive. Figures from Giuseppe Garibaldi to Benedict Anderson argue that nationalism is inherently opposed to imperialism as its fundamental principle is self-determination - people choose to be part of the nation.
Attributing coercion in post-colonial nations to the legacies of imperialism strips local people of agency. It pretends they aren't responsible for their own actions, making them doomed to stay trapped in the past acting on the ideas of "the West".