Wireless carrier support and features for iPhone in Africa - Apple Support
You do not say which exact model you have, where you bought it and with whom it was previously locked. Remember, this is an international forum and for all I know you could be posting from Antarctica. I believe most phones will work in other countries though some features may be missing or lack support. Generally it makes sense to buy the phone in the country where it will be predominantly used.
iPhone XR - Technical Specifications - Apple
Find the right iPhone for the right country or region. - http://www.apple.com/iphone/LTE/