Even Facebook operates in China. Their social network is banned (for refusing to comply to censorship laws), but the company is still allowed to do business. Facebook has quite a few advertisement deals in China.
Heck, walk down the street in China for 10 minutes and you'll see more McDonalds and StarBucks than you've ever seen in your life.
Since 2014 legal reforms, many foreign companies are no longer required to form joint ventures in China, and so own 100% of the shares (and technology).
Saying that "China doesn't allow foreign companies" is... unnuanced, to say the least.