In the UK Vigilante justice is punished extremely hard.
If you commit a crime in the commission of preventing crime you will go to jail. There's a couple of things that are permitted and they're outlined as "detainment without excessive force" - for citizens arrest, and then it's only for the duration until a relevant authority can be called... with a maximum term of time that authority must be called.. It's extremely limited.
And one of the offences specifically not permissible for citizens arrest is inciting racial hatred.
https://www.westminstersecurity.co.uk/news/citizens-arrest-u...
But it seems like they're also very restrictive on what you're permitted to do. Hacking has no justification in law.
in 2021 there was new laws added to help security researchers, but that goes out of the window as soon as you release private information (which has no justification in German law and may get you 2 years of prison time).
So, at least in the context of this thread; committing a crime in the comission of stopping a crime is not legal.
Or were you referencing something else?