[Shemot 22:15](https://www.sefaria.org/Exodus.22.15?lang=bi&with=all&lang2=en) states:

> וְכִֽי־יְפַתֶּ֣ה אִ֗ישׁ בְּתוּלָ֛ה אֲשֶׁ֥ר לֹֽא־אֹרָ֖שָׂה וְשָׁכַ֣ב עִמָּ֑הּ מָהֹ֛ר יִמְהָרֶ֥נָּה לּ֖וֹ לְאִשָּֽׁה

If a man seduces a virgin who is not betrothed and lies with her, he shall provide her with a marriage contract as a wife.

If pregnancy is assumed as a possibility of sex, this should mean this is not only permissible but mandatory.