Do dogs remember and learn from past experience? I believe they do; I also believe that knowing that about dogs can be helpful when were trying to teach them new skills and behaviors.
A couple of stories illustrate what I mean. In both of these stories, the teachers are not humans:
Ginger, a Beagle mix, often visits the home of some friends of mine. My friends have a cat, Sophie. Sophie is laid back but assertive when she needs to be. Ginger, like many dogs, barks, jumps and generally acts like a jerk when she sees a cat. When Ginger launches into her threatening display, Sophie ignores her if there is a screen door or other barrier separating them. However, if there is no barrier and Ginger gets too close, Sophie becomes watchful.
Once, when Ginger came too close for comfort, Sophie gave Ginger five quick smacks on the nose. Ginger crept back to her "dad" and clung to him for the remainder of the visit. That is not very surprising. But what shows real learning-from-consequences, I believe, is that ever since that incident, Ginger only displays aggression when shes safely behind a door or other barrier. When shes in the same room as Sophie, she keeps a respectful difference.
Teachers can be chance events, too: