That’s possible on very few phones these days. Only a handful of OEMs still ship phones that can be bootloader unlocked at all (at least in the US), and even several of THOSE require phoning home to the OEM to get an IMEI-dependent unlock key to pass to fastboot.
Source: 7 years of running deGoogled Android phones and 11 years of running ROM’d Android phones before recently moving to iOS and giving up.