In World War II, Japan and the European Axis powers had to communicate over strategy and other things. Also, their diplomats must have had to go to their own countries sometimes. After the USSR entered the war, how was this done? Was this not a major problem for the Axis Powers?
Diplomats enjoy certain immunities. When accredited as such, they can travel, except in "enemy territory," without interference (unless declared persona non grata), and only the least "civilized" countries will violate the sanctity and privacy of diplomatic pouches.
It was possible for Japanese diplomats to travel through the Soviet Union rather than for German diplomats, because technically, the Soviet Union and Japan were at peace, even though their respective allies were at war with the other. Hence, most of the communication between the Axis powers in World War II was done through Japanese diplomats based in Europe.
In addition to the other excellent answer, let me note that the Axis fought two very different and separate wars which required little coordination.
E.g., German raiders operating around Australia were a minor thing: they could get logistical support without additional communication (yes, I know that Kormoran sunk before the Pearl Harbor attack).
See World War II: Yanagi Missions -- Japan's Underwater Convoys for the full list of subs and their cargoes which consisted of armament samples, blueprints and raw materials - in addition to diplomats and mail.