You don't have to, but if the police turn up and arrest you (perhaps because you don't have a public entertainment license) that's your fault; you should have checked.
(Incidentally, if it was me dancing it would be bad enough to count as "Behaviour likely to lead to a breach of the peace")
Anyway the alternative is silly too. Imagine a world where ignorance is viewed as an excuse.
In this weird world I kill someone because I don't like them. The law probably considers that this would count as murder.
If I were to say "Oh, sorry, I didn't realise that was illegal- nobody ever told me" I could get off without charge.