I get that there is a grain of truth in what you are saying but this is mostly an outdated mode of thinking. The Japanese economy has plenty of access to $ denominated capital markets if they wanted $.
I will repeat. The Japanese don't have any specific need for dollars that they can't fulfill on a balance of payments basis. Some countries do. But Japan doesn't.
Earning money from foreign customers gives the Japanese as a nation purchasing power of future foreign assets, such as oil, food, or land outside Japan. It makes their country wealthier in the world. Exchanging currency does no such thing, because it gives the foreigners an equal claim against future Japanese assets: no net gain in wealth. Selling to each other also does not give them (as a nation) the increased buying power outside Japan that selling their goods and services for foreign dollars gives them.
Under your scheme, if a Polish person exchanges Euros for Yen in Japan and then buys a beer in Tokyo, did Japan just "earn dollars"? Because I think it's pretty clear that nothing referred to as a "dollar" moved hands here.
So, 'if a Polish person exchanges Euros for Yen in Japan and then buys a beer in Tokyo, did Japan just "earn dollars"?' Yes, they DID just metaphorically earn tourist dollars, and no, they did NOT literally earn any "dollars". I might also have said that thanks to the Polish customers, Japanese bartenders were able to metaphorically bring home the bacon, except that you would then probably get upset and explain to me that Poles in a Japanese bar would pay in yen, not in pork products.