The (boot)ROM is on-die, within the CPU, there's no way to replace it.
You can potentially replace the OS image (confusingly, often referred to as a "ROM") on the flash storage, but unless the bootloader agrees to boot it (either due to it being signed correctly, or due to the bootloader being unlocked) you're SOL.
You can potentially replace the OS image (confusingly, often referred to as a "ROM") on the flash storage, but unless the bootloader agrees to boot it (either due to it being signed correctly, or due to the bootloader being unlocked) you're SOL.