When a dog is dying or dies from a heart attack the dog will collapse lose consciousness, and stop breathing (not necessarily in that order).
All other of the dogs bodily functions will rapidly begin to shut down.
Unless the dog can be resuscitated within minutes, death will occur.
If a dog has a heart attack and lives then it may shorten their lifespan by at least a few years.
However some dogs have suffered heart attacks and have been treated and live their normal lifespan.
But I did have a dog years ago that had a heart attack and only lived a couple more years after the heart attack but the dog was already 10 years old at the time of the heart attack and was almost at his lifespan anyway.
Some signs of a dog that is about to have or is having a heart attack are the dog starts breathing heavily, coughing, swelling in the legs, bloated, fluid-filled abdomen and higher than normal body temperature (over 103° Fahrenheit) · Abnormal breathing · Vomiting · Heart rate over 100.
The most common cause of a dog dying suddenly is heart disease or cardiovascular disease.
Other things that can cause a dog to die suddenly are toxicity, gastrointestinal disease, trauma and non-traumatic hemorrhages.
Dogs already have a pretty short lifespan and it can be a sudden thing that a dog dies even before they are expected to die.
It can also be hard to tell or know whether or not the dog has heart disease, blood clots etc or is about to have a heart attack.
That's why if you can afford to it's important to take the dog to the vet for regular checkups so that if your dog does have heart disease it can be treated.
Not everyone can afford to take their dog to the vet though even though they love them dearly and that is okay.
Heart problems, Blood clots, abnormal heart rhythms, cardiomyopath etc are all causes of sudden death in dogs.