It's not an offence to wear a mask.
But to use it a mask to conceal your identity,
or if you to refuse to remove it when police ask you to do so,
then that can be an offence.
As a matter of law, wearing a mask to conceal your identity in a protest,
is not very different to wearing a mask to conceal your identity
in an armed robbery.