Peaceful protesting is generally legally protected in developed Western countries. Rioting, burglary, and assault are not, and police are legally and morally justified in using force to arrest the perpetrators.
You could do anything you want in protest. No where did I state that it absolves you of legal consequences. You protest in the form that you want, and if it’s illegal, the state will get involved.