I went to a certain phone company store to ‘buy’ a cellphone outright, without a ‘plan’ and they would not sell me one.
The clerk told me that even if he did sell me one it would not work except on their system, not on any others...............
I only buy my replacement iPhones from Apple in their stores. If you pay full price, the phone is unlocked when they hand it to you.
If you want a Samsung, they’ll sell you an unlocked phone directly. I think OnePlus & Google do the same.
I’ve never owned or used an Apple product.
I paid cash for my last phone, an unlocked A52 bought direct from Samsung. It works like a champ.