The first thing to do, is to understand where does the allergy come from. Is it due to pollen? A certain type of plant? The dust in the hay? A fungus infection?
Once you find out, you will be able to find the suitable treatment for that.
In a general case, horses that cough need their hay wet or purified. The less dust they breathe, the better they feel.
The best thing for you to do is to show your horse to a veterinarian who will perform tests and analysis to determine the source of the problem.