No, whoever told you that is misinformed, you can open a BRA company being a foreigner, regardless of your visa status. What you will need is a partner, which could be a foreign company and/or someone else. What you need is a brazilian administrador (registered agent), which could be your attorney or CPA.
There are no tax advantages for buying an apartment before applying for residency, as a matter of fact, you should take advantage of bringing the funds for this purchase and get your permanent residency through the $ you are bringing and through the investment visa.