All Apple iOS devices have a model number which looks something like this: MC605LL/A. The MC605 is an iPhone 4, black, 32GB. You can find these numbers on the Models page. The two letters behind it, LL in this case, specify the region code. The following list gives an overview of all these region codes.
The region codes are probably used to separate the same device by region (different charger, packaging language, etc.).
It is not possible to see to what carrier the phone is locked (or not) by just looking at the model number, but it gives you an idea where the phone was intended to be sold.
It is also noteworthy that my iPhone 4 had a model number MC605FD/A (locked) and it was warranty-exchanged in a Swiss Apple retail store to a MC605B/A. The employee at the Genius Bar locked it with my SIM. I can prove that, because I intentionally gave him the wrong SIM to see if I accidentally get an unlocked replacement phone. When he activated it, it got locked to the "wrong" provider. When we noticed that, he had to get another replacement phone and lock it again to the "correct" provider. This means that even locked phones are initially unlocked and get locked to the carrier of the first inserted SIM. --http
The following list shows the possible region codes.
|Egypt, Jordan, Saudi Arabia, United Arab Emirates
|United States (Assembled in Vietnam)
|Ireland, UK, also used for some replacement units
|Brazil (Assembled in Brazil)
|Brazil (Assembled in China)
|Austria, Germany, Netherlands
|Austria, Liechtenstein, Switzerland
|Colombia, Ecuador, El Salvador, Guatemala, Honduras, Peru
|USA, Canada, also used for some replacement units
|Chile, Paraguay, Uruguay
|Macau, Hong Kong(?)
|Belgium, France, Luxembourg
|Australia, New Zealand
|Hong Kong, Macau
More information here.