China doesn't ban US tech that obeys the CCP's surveillance laws, like Apple does. This targeting of tiktok is pretty specific by US government, because it singles out a company rather than act as a law.
If China is able to ban all western social media because of “law” then per definition any law that stops Chinese social media is also “legit” if we go by the argument that it is okay to ban things if the law says to ban them.