Has she formally intimated the status in writing? If not, ask your friend to do so immediately. A simple email one the lines of โhey, we discussed this, I am formally writing to let you know that I am pregnant and will discuss maternity leave, role planning etc. in due courseโ will suffice. If her discussion has been oral so far, they may kick start the formal PIP or other action and pretend they did that in good faith without prior knowledge of pregnancy.
Second, dismissal of a pregnant woman during maternity leave โor on accountโ of such maternity leave is prohibited. There is fine and potential criminal prosecution, so most companies are reluctant to outright fire people. They may either try to bluff it out, or engineer a retrospective narrative about performance (which seems to be the case here). She may keep her old performance evals ready, just in case.
Realistically though, she may want to, in her own interest, look for other jobs. Good luck.