This also depends on what model they have.
Identify your iPhone model - Apple Support
If the model is only able to be used on GSM networks it won't be able to be used for all networks. For example, an iPhone 7 model A1778 could be unlocked, but would only be able to be used on AT&T or T-Mobile. It's physically impossible for this model of phone to be used on a CDMA network.