I was going to say something similar. Plus, I've had dogs that will bury bones & dig them up later and hide their own treats & toys from their pesky feline housemates.
Positive and negative reinforcement worked with my dogs to alter their behavior or to learn tricks. I don’t think this would work if dogs had no memory.
If I say “roll over” and it’s a command my dog knows and he also knows comes the trick comes with a treat upon completion from day to day, this dog is remembering what roll over means and he’s looking for his treat when he obeys the order from what he learned in the past.