Bear in mind there are airports in the world at less than 0ft sea level. Very complicated to validate what a valid input actually is
There is the radio-altimeter which uses ground based radar but that is for spoken-aloud altitude readouts and terrain warnings and as far as I’m aware doesn’t factor in Boeing or airbus autopilot.
At least in the U.K., the lingo has us refer to this always as height (ie, above the ground) and not altitude (within the air above a hypothetical sea level)