Thank you for your question; it’s true a 12 year old girl is still young. But if she has shown all the signs of puberty, including having periods, she can absolutely get pregnant when she does unprotected sex. But it’s not safe at all for a young girl of such an age to get pregnant. Her parts of the body that are designed to carry the baby for nine months and those that the baby will pass through are not yet ready, because that’s when they start to grow.
So when she is pregnant she needs to be followed up by medical doctors, because this pregnancy can even cause death. She can face difficulties during delivery. So pregnancy at a younger age is not good, it has consequences. It’s always good to have enough information about how you can prevent it. If you don’t, please find a trusted adult to support you on this.