A few possibilities here, but what you are describing sounds like it may be tracheal collapse. This can happen in toy and small breed dogs as they get older, and it is characterized by a dry, honking cough that is usually worsened by exercise, obesity, heat, humidity, and exercise. The fact that he improved when he lost weight supports this possibility.
You may want to look up "tracheal collapse cough" or "collapsing trachea cough" on Youtube to see if it appears to be similar.
There are a couple treatment options that you might want to discuss with your veterinarian, including cough suppressants (hydrocodone, butorphanol, guaifenesin), anti-inflammatories (prednisone), and bronchodilators (theophylline, terbutaline).
In an older dog, your veterinarian may want to do a couple things to rule out other underlying problems (mass pushing on the windpipe, lung disease, etc) before trying medications, but with the concern over sedating him to take a look, it might be worth trying the medications first to see if they help.
Hope that helps. Please let me know if you have any other questions.
I had googled the symptoms and had come across tracheal collapse so was aware of that but the other part of the question I asked you have not answered. I asked if the coughing could be putting pressure on him internally and was that why he had starting passing wind and I mentioned about the dried blood around his bottom.
Yes, any cough can result in increased abdominal pressure, which can result in
flatulence and potentially some seepage.
Passing actual blood would be a bit more concerning however, as this is not common with a cough. If he is eating normally and his stools are normal, I wouldn't be overly concerned unless you know for a fact that it is blood. If that is the case, I would have him checked out by your vet to see if he has a concurrent problem.