I'm not sure we can say that the police is "aligned with Beijing".
Whatever one's opinion of what the protesters are demanding they are breaking the law and rioting (as per Hong Kong law that dates back from British rule), and many of their actions are simply not acceptable. They are really not helping themselves.
The police will respond to that anywhere.