Yes, everyone country does this. You can be barred from travel in a wide range of other circumstances in many other countries.
Every person has a nationalistic solipsism that renders them incapable of understanding events that occur outside of their own country. China and the US are two countries where this tends to be most severe, people outside these countries seem to believe they possess a profound and innate understanding of events there that renders them capable of offering a complete opinion (and, in reality, that opinion will almost always be entirely self-referential, 20% of the comments on this thread seem to be talking about the US).
At a high-level, the characterization of China as a lawless dictatorship is undermined somewhat by the higher levels of crime in almost every other country. You will see this interpretation of China from people in the US who live in places where there are constant, visible signs of crime.
Just because the US also does this doesn’t make it right for China to do it and vice versa.
Team coca-cola and team pepsi are both evil and illegitimate.