In both law and real life, there is a common understanding (to use your term) that rules may be violated for the greater good. Does driving an ambulance into the park violate the letter of the rule? Yes, but it's still OK because we give emergency vehicles wide leeway to break rules so they can save lives. Judaism even encodes this in a general principle: https://en.wikipedia.org/wiki/Pikuach_nefesh