In the Temple?
The Ark of the Covenant was hauled around from place to place. It took a place of honor in the tabernacles or in the temples. David literally danced before the Ark of the Covenant. He did it with groups of people, and alone.
Anyway, I said David "danced before the Lord" as one translation has it, not that he "danced in the Temple" because there was no Temple, and the Ark was on the way to Jerusalem.
Given that David actually prophesied Jesus' final moments I'll take David's example as sufficient for the purpose of proving that dancing is acceptable in the eyes of God.