I heard that it has to be activated first then you can unlock it.
It will ask for the account holders billing zip and last 4 of his social.
So If I buy an AT&T locked iPhone 5, take it my country it would not pass the activation screen? thus not being able to unlock?
If you buy an AT&T i5 full price you will be fine.
If you get one that's locked under someone's contract that hasn't done the initial activation then you will be stuck.
though replying late, but to help the readers, activation SIMs are available in the market which can be used to activate iPhone without using the original SIM, later on, IMEI unlocking can be done. like OneSIM at reverse.hk