You can install any OS you want providing that the phone's bootloader is unlocked. However you can't just go and download a generic copy of an OS and install it as you would on a PC, it needs to be specifically packaged for your phone, which is certainly not something regular people can do.
Or in other words, it depends on what phone you have and which OS you want to install.