It's a little more complicated, so let me explain. Let's say you are talking about Toyota making cars in the US.
What happens is that Toyota establishes a US subsidiary, which legally is an American company, even though its shares are owned by a Japanese corporation. (And in reality we have Toyota Motor North America, Inc.) And any cars made in the US by this subsidiary count towards US GDP (not Japan's), whether those cars are sold in the US or exported abroad. What counts for US GDP (for example) is whether sales occur for something that was produced in the US, regardless of who ultimately owns that operation.
The revenues from selling these cars do NOT flow back to Japan. The go to the U.S. subsidiary in America. Toyota North America does not just hand over its revenues to the Japanese parent company, because Toyota North America obviously needs the money to sustain operations: it's a legal corporation attempting to make a profit, and it can't be giving away its revenues.
Now, when Toyota in Japan, as a publicly-traded company, reports its revenues each quarter, the sales from the US subsidiary are consolidated into its overall corporate results. So Toyota, based in Toyoda Japan, does include those numbers when reporting its revenues. Nevertheless, the money from those US sales has not actually gone to Japan, it's still in America being used to buy parts, pay wages, build new factories, etc.
What MIGHT (or might not) be sent to Japan is the profits from the US operation. Toyota might have its US subsidiary pay a dividend to the parent company, and that's how money could be transmitted from the US unit to the parent company in Japan if so desired.