Were property rights of foreigners respected when war broke out and did they lose their foreign investments?
It is generally understood that a war is a temporary condition and, after it ends, the erstwhile combatants will have to resume normal relationships (the notable exceptions were the Nazi and Soviet invasions of Poland and Barbarossa where the invaded states were supposed to disappear forever).
This means that the foreign-owned industry is told to produce whatever materiel is deemed necessary for the war effort. The fate of the profits depends on how cooperative the owner is: friendly foreigners (e.g., Swedes for Germany) may be able to keep them, enemy - not so much (obviously). After the war the property is usually restored to the original owner, less indemnities, reparations &c.
The notable exception is the Bolsheviks after the WW1 who confiscated all foreign property (and an attempt by the West to negotiate its return - as well as the government debts - was so entertainingly described by Bazhanov).
According to Charles Higham, American companies had investments in Germany amounting to $475 million when Pearl Harbour was hit. Higham says
Though it would have been more patriotic to have allowed Nazi Germany to confiscate these companies for the duration—to nationalize them or to absorb them into Hermann Göring's industrial empire—it was clearly more practical to insure them protection from seizure by allowing them to remain in special holding companies, the money accumulating until war's end.
For individuals, a preliminary study called 'U.S. and Allied Efforts To Recover and Restore Gold and Other Assets Stolen or Hidden by Germany During World War II' says that 'enemy aliens of Jewish origin' were assured that their property would not be confiscated (this was in 1940, but German Jews were not protected). Presumably, this means non-Jewish foreigners in Germany also did not have their property confiscated, but it's not clear if this applied to foreigners who were from countries Germany was fighting.