@anamur-- That's a great question! Yes, companies can invest in any other country that is open to foreign direct investment. There are different rules and restrictions to investment in different countries. I know in China, there are lists of encouraged, restricted and prohibited investments and they decide on those based on which markets they want to allow investment in the country. In India also, foreign ventures and capital investment requires permission from the Central Bank of India.
A country might want to invest in other countries for different reasons. Foreign capital investment decisions are made based on market, resources, assets and efficiency.
I'm sure you've heard of a lot of US companies moving their production facilities overseas to Latin America or China because of lower worker costs. A company who invests in China can benefit greatly if it can buy the resources it needs at lower costs there, if it can benefit from the market and sell its products and services in China, if production will be more efficient and also if it can make capital investments that will gain from China's growing economy.