Is it legal to raise funds before the company goes public?

Legal, but it must comply with Article 13 of the Securities Law. Article 13 of the Securities Law stipulates that a company that publicly issues new shares shall meet the following conditions: (1) It has a sound and well-functioning organization; (2) It is profitable continuously and in good financial condition; (3) There are no false records in the financial accounting documents in the last three years, and there are no other major illegal acts; (4) Other conditions as stipulated by the the State Council Securities Regulatory Authority approved by the State Council. Non-public issuance of new shares by listed companies shall meet the requirements stipulated by the securities regulatory authority of the State Council approved by the State Council, and shall be reported to the securities regulatory authority of the State Council for approval.