Can a baby survive before 24 weeks?

Yes. Babies born between 23 and 24 weeks can survive. If they do survive they have complications with bleeding into the brain, infections, breathing problems.
23-24 weeks earliest. The exact gestational age at which a baby can survive depends a little but on the hospital. Most consider 23-24 weeks to be the earliest gestational age when a baby can survive.