To which reference point on the aircraft is the altimeter reading relative to?
The placement of a probe for a pressure  altimeter has exactly the problem you mention, but they only need to be accurate within 75 feet, so placement is not a problem. 

For large aircraft, they use a "radar altimeter" which uses an electromagnetic beam to measure the distance to the ground, the same way police radars measure car speed. Radar altimeters are accurate to within a couple of feet.