Note: This post is a transplant. First published on 2017/10/09. It was written by myself on another site and has been moved.
I have had the good fortune to do a fair bit of traveling the past year. Reading AVC recently, the post seemed to indicate that the lock on the SIM card had something to do with the use of an iPhone (If in this case 'provider' means Apple and not T-Mobile). Being an iPhone user myself, this is not a situation I have faced in my travels and I suspect it is the carrier.
In my experience thus far, it is the carrier that does this regardless of the phone in use. Each time I have travelled to another country for longer than a few days, I have opted to buy a local pay-as-you-go SIM card and load it with data. Roaming is overly expensive (prohibitively so in the case of data) and in some cases unreliable. This strategy has worked successfully without any difficulty (apart from not being able to remember my 'local' number) in Chile (Claro), Spain (Orange) and Namibia (MTC). Interestingly, all 3 providers put expiry limits on the data - in Chile (if memory serves) and Spain, the expiry on data was one month after purchase. In Namibia (or Nambia if your only information source is Donald Trump) the expiry was set to one week. Expiry dates on data feel like a nickel and dime move on the part of the service provider but somewhat understandable at one month. At one week it just seems like money grabbing considering the poor coverage outside of the main towns in the parts of Namibia we travelled through.
Granted, not having cellular service was one of the great benefits of being in Namibia!
As long as you don't break down on the side of the road that is...