Yes. If you leave China before reaching the statutory pension age, you may apply in writing to terminate your basic old-age insurance and get the balance of your individual account paid out in one lump sum. Only the individual-account portion is refundable, not the employer-contributed part.
Nationwide (all cities)
Article 5: lump-sum refund or retention
The legal basis is Article 5 of the Interim Measures for Foreigners Employed in China to Participate in Social Insurance (MOHRSS Order No. 16): a foreigner who leaves China before reaching the statutory pension age may either keep their individual account (with contribution years accumulating if they return to work in China) or, upon their own written application to terminate the social insurance relationship, have the balance of their individual account paid to them in one lump sum.
Amount and inheritance
On the amount: the refund is the balance of the individual account only. The employer-contributed portion (the social pooling portion) is not refunded. Shenzhen's materials list and the Shenzhen government Q&A confirm the refund concerns the individual account balance; the relevant authorities require the application forms, passport, and a bank account. Article 6 adds that if the foreigner dies, the balance of the individual account can be inherited. Article 8 adds that social insurance disputes can be resolved through mediation, arbitration or litigation.