For old models like 3GS you may be possible. For first year iPhone 4 you may be possible. However once the firmware is upgraded beyond certain version, there is no coming back for unlock. You might be able to jailbreak, such as iOS5, but you can no longer unlock.
The holes were fixed above iOS4.3.5.
The last unlock was done using iPad's firmware on certain iPhone4. However, you will forever stuck with iPad OS and lost GPS.
It doesn't worth the effort to locate the "unlockable" devices any more. Either dump iPhone totally, or buy factory unlocked version for extra $.
Please visit redmondpie.com for official info about unlock etc. Many other sites that claim infinite unlocking capability are cheating liars.