You cannot use an eSIM if your phone does not support eSIM and is locked. In the case of being locked, the only way to be sure that your phone has been unlocked is to check the current policy with your service provider. The carrier locks your device for the validity period to prevent switching between carriers.
Check whether your device supports eSIM or is carrier-locked by following the instructions below:
Check if the device supports eSIM?
Go to [Settings]
Find [General Settings] > [About] or search for "IMEI" in the [Settings] search bar
Then "Check Series Number" and "IMEI" for the primary and secondary SIM cards. If the device has 2 "IMEI" numbers, then your device supports eSIM
Check if the device is carrier-locked?
Go to [Settings] > [General Settings] > [About]
Check the information
If it displays "Network Lock - No SIM restrictions" and "Digital SIM available - IMEI (included)" then your device supports eSIM.
If it displays "SIM restricted" then your device DOES NOT support eSIM, likely because your device is locked to a carrier.