There is no visa called birthing visa. Rather, you can applied for TRV for prenatal care purpose. It is not illegal but you have to proof that you're coming for medical reason/attention for the pregnancy. In short, most time Visa offers are not aware of the pregnancy has visitor visa applicants are usually not require to undergo medical examination. Since, their stay will be less than six months.
If you or others meet the requirement for TRV and declare in your LOE to IRCC about the pregnancy, then you will be good. For example, you'll need to proof that you've sufficient funds, will leave Canada at the end of the period that maybe authorized for your stay and are not inadmissible. Even health-care costs that relate to a high‑risk pregnancy (prenatal care and delivery) do not exceed the excessive demand threshold. Moreover, pregnancy isn't regarded as a medical condition.
Giving birth in Canada does not represent a violation of any terms or conditions that may be applied to a temporary resident.