Two problems:
- Locked bootloaders: if you're not given the option to unlock it, you can't boot anything other than the stock ROM
- Proprietary drivers: even if you can boot a custom OS, many Android phones have very unique and obscure hardware and the drivers for them are only distributed through their stock ROM.
The closest thing is LineageOS. If your phone doesn't support it, there's Generic System Images (GSI), but there's no guarantee of getting cellular service after installing a GSI due to proprietary drivers.
If you want something that just works, GrapheneOS is great, but you'll need an unlocked Google Pixel.