I'm so sorry for the loss of your dog...how terrible that must have been for you.
I am so sorry for your loss!
There are many possibilities for the sudden death, and as you know only a post mortum evaluation would give a definitive diagnosis.
However, I can speculate. Coughing can occur from a variety of diseases such as heart disease or from severe acute anemia. There is a malignant type of cancer associated with blood vessels called hemangiosarcoma. This type of cancer can occur in almost any organ but most commonly in the spleen and the heart. Hemangiosarcoma may not have any symptoms prior to death or collapse. It is responsible for many acute deaths in dogs. The splenic and/or heart based hemangiosarcoma tumor is blood filled. It can continue to grow in size until it finally ruptures which spills out a vast amount of blood depending on the size of the rupture. This causes acute internal hemorrhage. The affected dog becomes acutely anemic because the dog's blood is free in the abdomen, in the case of the splenic tumor or free in the pericardium, in the case of a heart tumor, for instance, and not in blood vessels. The blood can then pour out of the mouth since it is not contained in blood vessels. The rupture of the tumor can cause collapse and death.