If you bought your phone through a wireless carrier, it may still be locked to that carrier.
On iPhone: Go to Settings > General > About and look for Carrier Lock. If it says “No SIM restrictions,” your iPhone is unlocked.
On Android: Lock status varies by device. Check Settings under Network & Internet, SIMs, Mobile networks, or Network unlock. If you can’t confirm the status, contact your current carrier and ask whether your device is unlocked.