Sure, I could invest in an American company, and further industrialize my nation, but nationalism comes at a cost to me - the opportunity cost of the returns from investing elsewhere. I am sure you can see how if the returns are high enough, even the most nationalistic would choose to invest outside of their nation.