which smartphone are you planning to buy exactly?
if it is an iphone 4 (or even iphone 3GS), then please do check on the seller listing if it is 'unlocked' or not. most of the smartphone sellers (particularly for iphone) mention it specifically.
for example, if you buy an iphone with OS 4.0- there is no way to unlock it by any means even thru jailbreaking etc.
so be careful..