If i buy a iphone off craigslist can i get it unlocked?

I want to buy an iPhone of craigslist and i was wondering if I buy it from someone who's on a carrier like at&t or verizon can I take it to get unlocked

Didn't they make unlocking illegal?

You can but AT&T is trying to make it harder. Recently a law was passed that you can't unlock your phone without carrier consent. Also Verizon can only sim unlock for 4s or 5 not 4.So if your on t-mobile or straight talk. Get a AT&T iPhone. I would ask the seller if they would call their carrier for an unlock.

You can unlock only GSM network locked iPhone to use with any other GSM network. So unlocking an AT&T network iPhone is possible. Whereas unlocking Verizon network locked iPhone is not possible. If you need to unlock an iPhone, You can visit http://www.simpleunlocking.com/apple/rs16wp8/ and get the remote unlocking service for your iPhone. This method of unlocking is very safe, simple, affordable and quick. This method of unlocking also doesn't require a jailbreak too. Good lock mate.
Note: According to the new law passed in USA, As of January 26, consumers will no longer be able unlock their phones for use on a different network without carrier permission, even after their contract has expired. It is considered as illegal. To re legalize this law, You can sign in an online petition from https://petitions.whitehouse.gov/petition/make-unlocking-cell-phones-legal/1g9KhZG7 The petition closes on 23/02/2013.

Yes you can still have it unlocked. But however, you should know that there's a law passed making iPhone unlocking illegal. It makes a big difference when the time I have it unlocked mine when there was no law like this.