This isn’t a straightforward yes-or-no since every case is different. However, if you’re talking about if two people who are incompatible and unfit for marriage should marry just because of a say: no. Pregnancy should not be a primary reason to marry.
I advise that they wait till the child is born to make a decision. This will help them discern their relationship even better and know if they’re able to be married or not.
If they discover, in the course of the discernment, that they’re not compatible, they can give the baby up for adoption as this is better than either having a teenage mom raise the baby or a couple who don’t like each other marrying and raising a child in a hostile environment. Adoption brings own challenges but is better since it gives the child the chance to grow up in a loving, stable home.
If they discover they’re compatible with each other and can bear the financial and emotional weight of starting a family, then they can be married when they’re ready.
There’s need to consult with a professional – a priest, a counselor or someone very wise to weigh their options rather than simply take any option that seems okay to them at a particular time. Needless to say, abortion is not one of the options to be discussed.