Abraham was approached about bearing offspring--his faith was of utmost importance--Hagar isn't what God had in mind. Mary was approached about bearing offspring--again faith was in her response. This is not necessarily about allegory this is the stuff of spiritual law. Application of spiritual law or bearing witness of spiritual law in operation is not allegory for someone who takes spiritual things to be of primary reality. The carnal mind is fixated on the physical. Spiritual does not necessarily mean allegorical. A hair split is not an allegorical hair. And who splits hairs for the sake of splitting hairs? In any case, a hair had to exist to be split. Real events can be 'split' or broken down because they were intentionally enriched with 'code'.
As for religious legalism, I am unaware of Jesus Christ ever pushing such an idea. As for practical and pragmatic spiritual truths, that is what I have discerned. However, hair isn't always allegorical.