Well, I'll disagree. I think that she was "officially" wrong.
She should not have been bringing items to be served at a meal in someone ELSE's house.
She was wrong to argue with you about whether your child could have a cookie.
(As an aside: I finally stopped having arguments that I knew I was going to lose, especially in front of my kid. Because arguing w/ Grandma and then caving simply taught my child that my authority was weak. So I'd cave without argument, or I'd leap immediately to a compromise posiiton and stick there--but if I argued, I got really heavy-duty and I won, by god!)
And I think she was wrong not to leave the rest of the cookies with you. Especially to leave only two? That's bad form. The only acceptable thing for those cookies to have been was a hostess gift/gift for the household.
Hindsight's 20/20, of course, especially when one is not the person involved in the situations, but what I *wish* you'd done is say, "No, that's all right, I didn't want you to bring those in the first place, so you take them ALL home," and take the container out of her hands, dump all the cookies back in the package, and hand it to her.
But I agree that you have a couple of reasons to believe your mom was out of line.