My dog is not allowed on my bed. Ever.
One night I dreamed that my heart was racing and I was on the brink of a heart attack if it kept on racing. I felt a sudden weight on my chest that woke me up to find my heart was racing in reality.
My dog had leaped on the bed and was laying on my chest, which woke me up. After waking, I was able to relax and get my heart rate to slow.
I’m not saying my dog saved my life from a heart attack, but it reminded me that dogs have a sense of trouble and then act without inhibition. Call it mythology or whatever you like. I just call them “dialed in” to things we miss. Whatever it is, there is deep body of history where dogs have been of great service to their owners in a wide variety of ways that defies simple explanation.
Also, with an otherwise healthy heart, simply accelerating the heart rate isn't going to cause a heart attack. That's just not how it works.
But if you prefer to believe your dog is a Guardian Angel in disguise, or otherwise anthropomorphic, that's certainly your prerogative.
I remember some wishful thinker posted a video of a dog running in front of a fire truck to a house fire. The FR wishful thinkers insisted the dog was leading the truck to the address. The reality is that the dog was doing what it had always done, viz. run in front of any vehicle to his house. He was playing.