CDMA carriers can activate a phone not sold by them by ESN. However, some carriers have decided that they would prefer you to buy a handset from them and refuse to activate devices that weren't sold by them. Sprint has a policy of not activating any ESN that comes from a phone they didn't sell. I'm not sure if that applies to the iPhone since a non-Sprint iPhone would really be the same device. Anyway, unlike SIM cards, you're more at the mercy of whether a carrier will activate it or not.
CDMA carriers can activate a phone not sold by them by ESN. However, some carriers have decided that they would prefer you to buy a handset from them and refuse to activate devices that weren't sold by them. Sprint has a policy of not activating any ESN that comes from a phone they didn't sell. I'm not sure if that applies to the iPhone since a non-Sprint iPhone would really be the same device. Anyway, unlike SIM cards, you're more at the mercy of whether a carrier will activate it or not.