In South Africa, our phones are unlocked by default. It's law, apparently. However, almost all phones come with either a GSM receiver or a CDMA receiver. The two are incompatible. As far as I can recall, Apple began equipping the iPhone with both because you get both CDMA and GSM networks in the states and they didn't like making two versions of the phone. Samsung, for example, has a different version of the Galaxy for just about every network in the States because of some weird carrier exclusivity thing. I'll also note that CDMA's main purpose is to lock phones into one carrier. As far as I know, there is no SIM to simply be swapped out. I hear there are ways of unlocking phones, but from my questioning on these forums earlier, it would seem that in Japan, at least, they will not give you access to their network unless you bought the phone from that specific carrier.
I do know Samsung has released some "Duos" phones that are made with both receivers, but they've mainly been targeted at India if I recall correctly. I personally wouldn't get those phones even if I could because I'm a fan of Android development and modding and there wouldn't be a large international support community like there is with, for example, the Galaxy S.
It's not like having a different phone means you won't be able to interact with people who have iPhones, it just means you won't be compatible with a few of the Apple-specific services like iMessage. There is always WhatsApp for that kind of thing, of course.
One last thing is that you won't be able to bring in a phone and get it on a Japanese Network. I was thinking of doing the same thing, but no luck. You'll sort out things in Japan and get a brand new, shiny phone! Otherwise you can pay exorbitant fees and get data roaming if it's especially important to you that you keep in touch with family when you first get to Japan.