Octane is LESS required at high altitude, and the suppliers partially take this into account. In Denver or Albuquerque, the premium at the pump will only be 91 or 92 octane, and regular will be 87 and I have sometimes seen as low as 84.
This can cause problems with supercharged engines (turbo or mechanically powered) because the forced induction compensates for the altitude related loss in density.
I don’t recall seeing a rule of thumb, but based on what I have seen at the gas pump, it looks like you can drop about 1 octane point for every 2500’ of elevation, and it is also not linear. I have never seen a clean normally aspirated engine that will knock at 8 or 9,000’ even on low octane gas.
It used to be that you could hear knocking on acceleration and know if you were running the octane too low. Now cars have more sound proofing, and the electronic engine controls back off the ignition timing at the first hint of knocking. So running too low an octane rating will hurt power and fuel milage a little bit. Some BMW motorcycles don’t do this automatically, but have a jumper you move to tell the computer you couldn’t buy premium on the last fill.
Your owners manual will tell you the minimum octane needed for your engine design. Beware that American pumps show R+M/2 derived Octane ratings while some European marques may use a different based rating that gives a number a point or two higher. (I know this is the case with BMW motorcycles). This results in high compression engines with a specified octane requirement that will never be seen on an American gas pump.
On one occasion I ended up late at the airport and didn’t want to make a fuel stop to fill my motorcycle, so I filled it with 100 octane low-lead avgas (no cat on that bike) and it ran exactly the same as on pump premium.