Top of the factory screen, the first tab on the left at the top of the screen displays your own provinces' factories. The end tab on the right (Projects) allows you to invest in factories that your own capitalists are planning or acquiring materials for. If you click the (second or third?) tab for foreign investments, it brings up a list of countries. Click a country, and if BOTH your country and theirs allow governments to build factories, you can select a province in their country to build a factory in the same manner as you build it in your own. If one or both countries do not allow governments to build factories, then there are no valid options. You should, I believe, also be able to invest in factories that foreign entrepreneurs are building, but I haven't seen an opportunity to do that yet. Again, if it's not allowed, then the options won't appear.
If you don't have the final Heart of Darkness expansion, then your version of the game won't include it. I only got the expansions a few months back, so I'm only recently learning this stuff myself. The original printed manual for the base game obviously doesn't cover it.
Note that building a profitable factory in a large and civilized country such as Bavaria can help them reach GP status, making it impossible to sphere them until/unless you or someone else knocks them back into the ranks of secondary powers.