"Do you wish to dance" is formal—appropriate for balls, galas, or events requiring traditional etiquette. It signals respect and ceremony.
In casual settings (parties, clubs, informal gatherings), it sounds stiff or humorous. Natural alternatives:
Formality is contextual. The phrase itself is grammatically formal; its effect depends entirely on the room you're in.