Change BIOS Settings, Configs and Registers

I want to change BIOS settings and registers in any way that is possible in any OS, for example, I want to change the MSR_SMM_FEATURE_CONTROL register.

Is there any way to do this programmatically or change bios firmware and flash BIOS with changed firmware or any other way?