(I've the feeling that during civil uprising in dictatorship or democracy, the police tends to serve and protect the hand that feeds them, rather than the oppressed people.)
We must have a different definition of "thug" because the "thugs" in my high school didn't become police. They became the people who shoot 11 people in a weekend, steal cars at 15, and commit disproportionate amounts of - especially violent - crime.
Thug: a violent, aggressive person, especially one who is a criminal
The problem here is you've taken the last part as the whole.
There were plenty of thugs as you say that have no social inhibition and get imprisoned. But there are numerous others that got along well enough and covered for each other they kept themselves away from punishment. There were cruel bullies in my school while committing vicious acts had enough of a following they could depend on them to blame the victims as the entity that started the fight. This type of person is well suited for the thin blue line.
The ones that are smart behave well enough to graduate, and then go work as police, ICE, prison guards etc. Basically anywhere you can beat people and get away with it because "qualified immunity" or "the camera suddenly turned off right then" or...
I've been a part of a local right-wing militia several years ago. Out of ~20 people involved, we had two active cops and one retired. And the stories they told made it abundantly clear that most of their PD (Seattle) is like-minded.
So when push comes to shove, they will absolutely be on the side of the feds if Trump goes all in.