Must the head office be located in Japan?

The head office should be located in Japan if you set up a company in Japan.
Another way to establish your company in Japan is to set up a branch office.
If you already own a company outside of Japan, you can set up a branch office in Japan and in that case, there is no need to set up a head office in Japan.