I don't know if they have a theory of mind, but some animals absolutely have very complex behavioural prediction models for humans and other animals. I swear my last dog knew whether I intended to go outside based solely on how I stood up from the couch.