Pregnancy might be a result of zina, but not a proof. As zina can only be proven by four witnesses if an accusation was given or four testimonies from a husband who has no witnesses plus a fifth to curse the liar:
Those who commit unlawful sexual intercourse of your women - bring against them four [witnesses] from among you. ... (4:15)
Without witnesses the proof for a zina is not established.
And those who accuse their wives [of adultery] and have no witnesses except themselves - then the witness of one of them [shall be] four testimonies [swearing] by Allah that indeed, he is of the truthful. (6)
And the fifth [oath will be] that the curse of Allah be upon him if he should be among the liars. (24:6-7)
Therefore the majority of scholars hold the opinion that there's no hadd unless one has asked this woman/girl and have either got a confession or a statemenmt that she has been raped, oppressed/forced or had intercourse without knowing that her partner was not her husband ... so if the three later options appear the necessary proof to establish the hadd punishment are not met according to the hanafi, shafi'i and hanbali school of fiqh. Based on a story of a woman at the time of 'Omar ibn al-Khattab whom he found pregnant but didn't apply had on. This narration was reported by al-Bayhaqi, Sa'id ibn Mansur and ibn Shaybah.
أن عمر رضي الله عنه أتي بامرأة ليس لها زوج قد حملت! فسألها عمر؟ فقالت: إني امرأة ثقيلة الرأس وقع علي رجل وأنا نائمة، فما استيقظت حتى فرغ، فدرأ عنها الحد.
The malikis say if the qadi can't find any of the signs of these three options the proof for hadd is established, when this woman is known, if she came from outside not! Their evidence appears also in both sahihs:
Malik related to me from Ibn Shihab from Ubaydullah ibn Abdullah ibn Utba ibn Masud that Abdullah ibn Abbas said, "I heard Umar ibn al- Khattab say, 'Stoning is in the Book of Allah for those who commit adultery, men or women when they are muhsan and when there is clear proof of pregnancy or a confession.' " (al-Muwatta' and Sahih Muslim)
Ibn Taymiyyah said if a woman was found pregnant and no clear reason for pregnancy can't be found had should be established as long as she can't exclaim a doubt.
Doubt here means that she didn't actually actively commit zina, but somebody used her unconsciousness (for example she was sleeping deeply, or was expecting her husband while being sleepy or had taken strong medicine that made her unconscious) to commit it on her.
This doubt is what 'Ali () tried to ask about before punishing al-Hamadaniya. As he asked her whether it is possible that a man came and had intercourse with her while she was sleeping, or a man forced her etc. This was reported by al-Bayhaqi and imam Ahmad in his Musnad.
So it is the usual case to clear any doubt and seek a clear confession before applying the hadd of zina! Note that in case of pregnancy the hadd might only be applied after the woman gave birth or even after she stopped breast feeding her child as practiced in the sunnah.
The hadd in case of a proof for zina is either 100 lashes and a banishing for a year, for a non-married woman, note that in case of a woman a mahram should stay in her company (this must be taken in consideration) as else this punishment may lead her to do further sins! Or stoning to death for a married woman. In case of a married woman, whom's husband has no witnesses she can also get free from a worldly punishment by doing the same testimony, but the person who is lying among them might expect a punishment in the hereafter (read 24:8-9).
- islamweb #54129 -in Arabic- is pregnancy evidence enough to apply hadd.
- islamweb #28539 -in Arabic- is zina proven by pregnancy.
- islamweb #121413 - in Arabic- the views of scholars on the pregnancy of non-married woman.
- islamqa #198743.
- islamqa #212139 -in Arabic- is had applied on a girl who has been found pregnant.