The simple answer is no, you cannot drink coffee or alcohol while wearing clear aligners such as Invisalign - you can only drink water. Coffee has a risk of staining your teeth or causing damage to your aligners.
Every time we eat or drink, our saliva starts cleaning and neutralising the acids introduced into the mouth - such as those from soft drinks or produced by bacteria that feed on food remnants. When you have aligners on your teeth, saliva cannot reach the teeth effectively. This can prolong the contact between acid and the tooth surface, potentially causing damage to both the teeth and gums. This is why it is very important to clean your teeth after eating and before putting the aligners back in.