It is possible to unlock a 3G iPhone with a sim card adapter available online for around $40-50. I've heard good and bad things, but it just depends on which one you get.
Also, if you can buy a broken/damaged iPhone, you can take it into an Apple store to get it replaced with a potentially new/most likely refurbished model (from Apple, though), for $200. So say if someone is selling one with a cracked screen for $50, you buy that, get a sim adapter for $50, and get the phone replaced, that's $300 + tax, and wouldn't have a contract tied to it.