A prescription of Aciclovir is normally indicated in the dental setting for Herpes Simplex infections.
Commonly this is when there is the need to treat the infection. But it must be made clear that if you have a tendency to have cold sores or similar when you are stressed, it can be very helpful if you are having a long procedure or a procedure that is stressful for you.
Examples are extensive dental treatment, or if you a having facial aesthetics treatment (e.g. dermaroller or dermal fillers / botox). Naturally your dentist would consider providing Aciclovir to cover you if you are immunocompromised, but the effect of stress on your susceptibility to Herpes Simplex can not be overstated.
Ask your dental professional if you can benefit from this.
