I always open and hold doors for people and it's only curteous to thank the person. So, when the door is opened or held for me, I thank them.