Can a baby survive if it is born at 31 weeks?

Yes. Of course it varies, but babies born at 31 weeks have a very high chance of surviving. Babies born on week 25+ are surviving (although some sadly donĀ“t).