I used to pet any horse I could reach across a fence, and feed them all kinds of things. Now, I might try to pet them, and maybe hand them a handful of sweet green grass but won't give them any treats . the owners could be very worried aobut a total stranger feeding them. could be, they wont' care at all. hard to know, so I error on the side of caution.
I am also very cautios about allowing a strange horse to put there head/mouth on my shirt or against my body . horses are unpredictable, and an unknown horse even more so. They have an instinct to mutually groom, so when you are scratchingthem, they will want to "groom" you with their teeth at the same time. Such action signals to the other hosre that they should continue grooming and all is dandy. But, sometimes this movement of the mouth (normally , when a human scratches them, they do it in the air , as IF grooming another horse) , if allowed to come in contact with you, can become a nip or a bite, almost by accident.
Also, since you groomed the dominant mare, and allowed her to mouth all over you and push into you, edemanding that you scratch her "here on my hip" , and "here, on my shoulder", you come off as actually subordinate , and the smaller mare, who is subordinate to the larger one, wants to see if you are subordinant to her, too. that may be why she put her ears back and nipped at you, mixed in with pestering you for scratches.
if you choose to scratch these horses, and I don't blame you for wanting to, you make sure its on YOUR terms. They do not put their muzzles on you, nor do they push against you , certainly not so that you lose your balance or have to back up/away from them.