They can understand language and obey basic commands, but they're not quite capable of abstract reasoning or problem-solving. Dogs also don't recognize themselves in mirrors, which is something that toddlers can do. The reason dogs don't recognize themselves in mirrors is because they lack self-awareness.
And it's not just dogs—all animals are lacking self-awareness, even the ones that seem to have it, like dolphins and elephants. Dolphins can learn to recognize themselves in mirrors, but since they can't communicate with us about what they see, we don't know for sure if they have any concept of who they are. Elephants are notorious for having their own personalities and engaging in complex social interactions with other elephants, so we suspect that they do have some sort of self-awareness after all!