When your dog is in a calm state, they are ready to learn and will do so even if you’re not intending to teach them anything. I was at a sportsman club in Maine chatting it up with folks when my German shorthaired pointer started tugging at the lead. Without much thought I reached in my pocket, called her in and treated her throughout the day. What I had inadvertently done is intermittently reinforced an undesirable behavior of lunging on the lead. The dog learned that if she goes to the end of the lead the doggie Pez dispenser unloads its payload of treats. I’m to this day trying to extinguish that behavior.