Many dogs will have an episode of coughing at some point in their life. In most cases this will resolve without any treatment and dogs will not be particularly unwell. The most common cause of coughing in young dogs is 'kennel cough' - in most cases kennel cough causes severe coughing for 2 or 3 weeks although affected dogs are not unwell. In older dogs coughing can be due to a variety of problems and may be the result of diseases of the lungs or heart.
If your dog has been coughing for more than 3 or 4 days or is unwell in any other way with a cough contact your vet for advice.