An allergy cough happens when you breathe in a substance (allergen) that your immune system recognizes as dangerous, though it's not. The cough is typically dry and non-productive, meaning it doesn't bring up mucus. It is sometimes described as having a "barking" or "hacking" sound.
Source: Verywell Health