A dog knows that the cat won't enter the backyard if he thinks the dog is free to roam, but will enter the backyard if it thinks the dog is restricted to the enclosure.
I call that theory of mind, because the dog needs to distinguish what it knows and what the cat knows.
You can have stalking behaviour based on simple ingrained unconscious if-then rules (don't be seen basically).
Showing yourself on purpose to change what you think the other animal thinks your capabilities are is more complicated and harder to evolve as a hardcoded reflex IMO.
Dogs weren't evolving in backyards with periodically opening see-through enclosures.
But yes, I'd assume most stealth predators with sophisticated brains (for example mammals) have some kind of theory of mind. It's just too useful not to have it. Same goes for animals living in complex social groups.
A dog knows that the cat will run when the dog charges. Is that theory of mind?