In my parents neighborhood, where I used to trip a lot when I was a young'n, My typical tripping night consisted of me and 1 to 3 of my close tripping friends staying over at my parents house, my parents fall asleep around 11, we take our drugs, at about 1 or 2am we always would sneak out the window and go walk around the neighborhood.
(some times we were rolling, not tripping)
Anyways. We would always walk around my neighborhood in the middle of the night and would always walk around this one turn and run into this beautiful white dog that was always really happy to see us, he would then start walking with us like he was one of the group as we continued walking around the neighborhood until the sunrise.
We would always get to the turn on the neigbhorhood that leads off to the private street my parents house was on and basically all tell the dog "this is where we have to part, I wish you could come home with us, but my parents would be like WTF"
And the dog would just continue walking around the neighborhood to go back to the side he lives on (im assuming, I still dont know what house he lives at)
Then we would walk up to my house and sneak back into my room and listen to music and chill and eventually go to sleep.
There came a time in my life where I got in a lot of trouble and my parents restricted me from staying over at friends houses or having friends stay the night at my house for like 1/4 of the year...
Durring this time in my life I kept doing drugs, but just by myself, I would eat mushrooms, or take MDMA, or take acid on pretty much every single friday night durring that time of my life.
I would still sneak out of the window and go walk around the neighorhood, and run into this dog, who became my new trip partner.
By the end of the 3 months it got to where on saturdays, when I would open my window to go sneak out, my new friend would be waiting outside the window already.
So in short, YES, I believe pets know when you are tripping... even if they are not your pet, and not actually with you when you are tripping..... (imagine how that revelation was when I was tripping and openned the window to see that dog waiting outside my window for me already lol)