Some children find it really difficult to jump straight into a new environment especially in a dance class. Your child may love dancing around the house at home and singing their hearts out but as soon as you enroll them into a class they want to leave, refuse to join in or even cry the whole lesson. This is completely normal! Your child dances because they expressing their happiness and they are comfortable in their environment but I can guarantee if you keep bringing them back to class they will realize how much fun it really is and then you won't be able to get them to leave. I know it is hard to leave your child especially when they are not happy but this is a good way to teach them about how to approach strange environments for the future for example School or daycare.
Be persistent otherwise your child will think this is the way to react in an unfamiliar environment. It may take one lesson it may take weeks but the change in attitude is rewarding for your child, the dance teacher and you!