All decay must be treated before orthodontic treatment begins, whether you will be having braces or aligners. In certain cases, if a cavity does not interfere with bonding the braces, its treatment can be postponed until the teeth are better aligned.
If a cavity is between severely crowded teeth, it may be treated once they have been aligned, so that it is easier for the dentist to reach.
This answer is for general information. Your own case needs an examination by an orthodontist.

