Can it hurt the baby?

If you're taking birth control but have sex and get pregnant and not know it could it hurt the baby?