Can I buy an iPhone in the USA and have it activated in another country?

I want to buy an iPhone for a friend in china as a surprise but I don't know if he'll be able to activate it over there. I'm going to buy it without activating it with any phone company here (is it possible?) and just sending it to china and him activating it with whatever phone carrier over there. I want to know before purchasing.

That's a good way to get on a list from Homeland Security…

As long as its not under contract and unlocked, yes

you have to buy these online or through the apple stores, as no other standard reseller sells them this way.

I purchased an iPhone 8 plus in the US and took it to Argentina for a family member. My family member has not been able to activate it. His phone company tells him he needs a code from the iPhone company. Is that correct? And if it's not, what does he has to do to activate the phone.