A friend of my travels internationally and buys a sim locally prior to leaving. You can do the same if you have a compatible device. He uses iPhone and it works great.
Unless your phone is prepaid, it is not locked. You do not void your warranty by using another carrier SIM card. In many countries it’s cheaper to use local service.