As mentioned previously, the flange distance isn't an optical limitation, but clearing the mirror is a mechanical one. As long as you clear the mirror, the rear elements can stick out behind the flange and into the mirror box.
Some early Pentax M42 SLRs have either an orange or green 'R' on the rewind knob. One allows the use of certain lenses that protrude further than others, the other doesn't (I can't remember which is which). The flange distances are identical, changes were made to the mirror to allow use of the lenses.
At one point, M42 was seen by many as a standard mount. Pentax used the same flange distance in K mount to allow easy adaption of existing lenses. Others picked different distances for their own reasons.