Congestive heart failure is when a dog has edema of the lungs due to heart disease. Among other symptoms, this results in a wet, phlegmy cough caused by the excess fluid. A dog cough due to a heart condition indicates that the heart is no longer able to compensate and is a sign of advanced disease.