Buying a phone at the USA as a tourist

I live in a overseas country and im planning to travel to the USA in a couple of months. Im thinking of buying a phone over there. Im just worried if buying a phone at the USA, would it work in my country, would i have to buy a unlocked phone? and if i bought a phone off contract, does that mean would that work in my country as well? Ive found that stuff in the USA is much cheaper compared to my exchange rate so im finding out is it worth it buying a phone.