Some days I pop into the chemist for shampoo or some other non essential. The sun is shining, DCs have been cheerful and well behaved, I have had enough sleep. You know the kind of day? Well on that day, I would have been delighted to have the door held open for me and exchange a few words with your son. I would have thanked him and complimented him on his manners.
On another day I might be going in after having a mc to get painkillers and pads. I might have screaming DC with me, my nerves are shot to pieces, it is pissing rain and I have to wait for a 4yo to deign to open the door and them am expected to chat politely to him.
Can you see how it could go either way?
Your son was NBU to think a thank you would have been nice, but he was unreasonable to say so, it is a learning curve and he has now learnt.
The woman was BU to not say thank you all things being equal,but at the same time if for any reason she didn't want to engage with your son, that is fine too and she should have been left in peace.
Maybe teach your son that most people love well mannered children, but if for any season someone does not seem to want to talk to him or smile at him, they should be left alone. Everyone wins.
I sympathise with one aspect though, the line between too young to know better and precocious is a fine one and it is a steep learning curve for children to get over saying what they think!