It's also important to point out that status and power are key to making this image work.
We feel like it's safe to find the image funny because the person in the photo looks like they have some amount of power or profile.
If that portrait was a crying child refugee and the dog was an army dog leashed by a soldier, then the picture wouldn't be as funny because we'd see the soldier as the one with more status and power than the child, so we'd think they were a bully.
But when it's a wandering street dog cocking his leg on a giant photo of what we presume to be a high-status celebrity or political candidate—that power differential makes it funny.
It's not the point of this lesson, but this—challenging status relationships—is a key function of comedy.