Dogs imitate, but don’t ape quotes a study that shows that dogs not only imitate behavior but they understand the goal and the workarounds.
In the study, dogs were faced with the task of opening a container with
food by pulling a rod. Whereas dogs prefer to use the mouth for this
task, a female dog was trained to open the box with her paw. When the
other dogs observed the female’s action, they imitated it in order to
get the food. However, the dogs imitated selectively. They used their
mouths instead of their paws for manipulating the rod when they had
seen the demonstrating dog using her paw while holding a ball in her
mouth. However, when the demonstrating dog’s mouth was free, the dogs
imitated her action completely and used the paw themselves.
So they understood she was using her paw because her mouth was full!