If you have indefinite leave to remain, getting into minor trouble with the police will usually not result in that status to be revoked.
However, if you are applying for citizenship, you will need to prove your “good character”. Usually citizenship will be refused if you have had convictions or even certain police cautions in the last three years.
Your indefinite leave to remain can be revoked and you can still be deported if you receive more than 12 months prison sentence or are convicted of very serious offences, but it is unlikely that this will happen at demonstration.
The Home Office guide to when to curtail someone’s leave to remain is fairly easy to understand and is worth a read.