Normally speaking, it is impossible. What is the so called black eye? Black eye is usually referring to blood and fluid collected beneath skin the swelling and discoloration of the skin around eyes. In most cases, black eye is caused by injury to eyes or face. Some surgeries on face might cause black eyes, for example sinus surgery. Coughing is a very normal action that we might experience frequently. So far, it is very common to find bloodshot in eyes because the capillaries in eyes are very fragile and delicate. The force of coughing would easily break the capillaries so we might have red eyes after coughing, crying or weightlifting. Anyway I have never seen anyone got black eye because of coughing. Black eye is just like a brasion around eyes. It usually heals up within days without requirement of other treatment. If you want to accelerate the recovery process, you can apply cold compress right after it happened to control it. After 2-3days, you can apply warm compress to promote blood circulation and help remove stasis.
I don't think coughing can cause black eyes. Anyway, you could use the warm compress to make your symptom release to some degree. You just need to prepare the clean cloth and hot water. You need to adopt the hot clean cloth to cover on your eyes. Then you will feel comfortable at the eyes and the black eyes will be released.