Can I buy a locked iPhone and then just unlock it?

I'm sorry for all my iPhone questions but I was wondering, if I get a locked iPhone from the store, would I be able to unlock it once I purchase it? Are there other shops or places wherein they could unlock the iPhone? It's just that, the locked iPhone is so much more cheaper so if I could get it unlocked after I buy it, then why not just buy the locked one if it's cheaper right?

Suggestions please? Thanks!

*By iPhone, I meant the 4S. But does it also work on the 5?

Added (1). More answers please?

If you unlock an iphone as soon as you try and sync it to itunes it will automaticly be locked again by itunes.

You can't unlock iphone 4s.

YES. I factory unlocked my iPhone 4s at: http://www.iphonefort-mobile.com/. The iPhone becomes permanently unlocked and you can use it on other carriers in US. As well as internationally. I'm now using my iPhone abroad on vacation. The unlock was done amazingly fast in less than 2 hours. Great service.