If you buy your iPhone from Apple directly your phone will be unlocked and will be compatible with most carriers, if you purchase your phone via a carrier it will often be locked to that specific network.