you can ring Apple (i've done it) and confirm what carrier it's locked to if u have the serial and IMEI (it's written very small on the SIM Tray , if it's the original)
if the iphone isn't activated and at the start of the set up process u can't type that code - however, there's an 'i' button in the corner that gives u it