Your dog may just be getting excited and not really trying to attack you but instead may want to play with you when you're dancing.
But if the dog is actually trying to attack you when you're dancing and the dog is growling at you then that's not okay and needs to be corrected.
Your dog may just not like you dancing around but when your dog does start to attack you when dancing take a spray bottle and spray the dog with some water and eventually it should learn to leave you alone when you're dancing.