1. If your device is on iOS 14 and above open Settings and go to General.
2. Tap on About.
3. Scroll to find the option Network Provider Lock.
If it says No SIM restrictions your device is unlocked and will be are able to download and use eSIMs.
You will need to contact your mobile carrier to get your device unlocked. If your device was only recently unlocked, you may have to wait for the eSIM support to become available, as your carrier might disable it for a period of time for security reasons.