Some Android OEMs will allow you to unlock the bootloader and makes changes to the OS without any warranty problems.
Some years ago I had Samsung S2 where unlocking the bootloader was an offline activity. I don't remember how but doing that was quick and easy. Now I own a MotoG4 where unlocking means going to some website, entering my email address and then receiving unlock code in my email. If Motorola knows my email address, or can link the (supposedly unique) unlock code to my phone, what's stopping them from voiding my warranty?
I have a hunch that newer versions of some mainstream phones do not allow unlocking the bootloader, and this is going to become more and more common.