It is quite interesting that they made crypto legal in China. I don't understand their laws in that regard, but I don't think Chinese people, in China, are allowed to buy American stocks - as an example.
Crypto is not legal in China, to the extent it is a security (which is almost all crypto).
However BTC is. How that can be is because BTC is a mathematical algorithm, interacted with through thought. It would be like make clouds illegal, or prime numbers illegal - it can't practically be done, much as CCP would actually like to control everything in China, right down to laws of nature.
In theory a person in China can buy any US asset, but one big problem is getting currency out of China. For most people, there are many foreign exchange restrictions, so even if they wanted to, they could not really buy US stocks in any great amounts.
At a less theoretical level, yes, China knows it cannot stop BTC, but it also knows (game theory) that if you can't beatem, joinem. So, they are now moving fast to catch up again with Bitcoin adoption. Especially in Hong Kong, they are now pushing banks to fully incorporate Bitcoin and make it available to all customers.