It is not illegal for foreigners to own part of Chinese companies. It's generally illegal for a single foreign entity to own a controlling interest. Softbank and Yahoo invested into Alibaba relatively early on. It was incorporated in China. Their positions represented the majority of shares in the business, just not individually.
> It's generally illegal for a single foreign entity to own a controlling interest.
This is also not true. China, like all developing economies that have reached the global stage, allows WFOEs and FICEs [1]. There's significant taxes involved but these taxes are being decreased all the time .
(It's quite remarkable the stuff people believe about doing business in China. Really have to wonder where these ideas come from.)