My parents had 2 dogs, Irish setter and a mutt we rescued. The mutt was significantly smarter. I've seen her burying a bone she got in one place, notice that the other dog is watching, wait for the other dog to go back home, and rebury the bone in a different place.
This implies at least basic theory of mind and thinking about thinking. This wasn't the only evidence btw.
Before that we had a different dog, also a mutt. He was pretty aggressive and had a separate fenced area inside our backyard. There was a cherry tree just outside that fenced area and our cat liked to sit there, but only if the dog is locked in the fenced area. That dog learnt to close the gate to look as if it's locked and sit in there waiting for the cat to climb the tree, AND wait for us to go to school/work, and only then he would leave the fenced area and bark under the tree at the cat for hours. We only knew thanks to neighbors.
In general theory of mind is very useful to any social animal and especially to predators, so I don't think it's as unique to humans as some people say.
The more domesticated the animal is, the dumber it tends to be. Wild animals, or even strays, have to think to survive. I wonder if this also translates to humans given the articles about IQ peaking in the previous century.
I seem to recall an experiment with corvids (crows) that showed that they can figure out whether or not another crow can or cannot see a crow treat, based on the different angle of view.
In human children this ability (to realise that other people have their own point of view) is called "theory of mind", IIRC.
IOW crows can think about what other crows are thinking.