Hi, I am Dr. Peter and would like to help.
1- Has he been to a dog park or kennel?
2- Can you rub his throat for 10 seconds and see if this causes him to hack?
3- Besides the hacking any other symptoms?
Steve, this sounds like he may have an upper respiratory infection (kennel cough). If he develops a thick nasal discharge then this is caused by a bacterial infection and needs oral antibiotics. He will need to be checked by your veterinarian. In the meantime, give him 1 tablespoon of Robitussin DM every 4-6 hours.
If you have additional questions I will be glad to answer them.
It usually happens where there are many dogs like kennels. But, we need to remember these infections occur via aerosol (air) transmission. Even in your house, there had to be a dog around there that gave it to him. Now, this is most likely the cause, but, other things can present with similar cough like laryngeal paralysis (rare), but, for now start him on the robitussin dm and follow up with your vet if necessary.
It is not contagious to humans, they have there bugs and we have our own. Very species specific.