You may need to flash temporary carrier files to unlock bootloader via odin and re-flash the stock files. Though this process is simple, it may be different for carrier locked devices.
Note that the process described in further steps may vary according the device model, carrier contract and the country. This process will void warranty of your device and it may also cause irreversible damages. If you buy an unlocked Samsung phone without any carrier contract, the device comes with unlocked bootloader and you can proceed with rooting directly. You need to get them unlocked by contacting the technical team of your carrier which they wont help at all. Mobiles with carrier contracts such as T-Mobile, Verizon etc, have the complete authority over the bootloader status of your device.
The basic process is more or less the same. Samsung devices are released with locked bootloader and it is essential to unlock it before customizing your device from the core.