Yes a 12 year old boy can certainly get a girl pregnant by having intercourse and It's happened before as I heard in the news.
A girl can become pregnant as soon as they can begin ovulating and producing eggs which is between the ages of 11 and 12 years old and beyond.
So yes if a 12 year old boy is trying to have intercourse with a girl he needs to be wearing protection and that's another reason why you need to have a talk with the 12 year old boy if he's your son or if he's your daughters boyfriend you need to explain to him what the result could be should he have intercourse with your daughter.
Having a baby is a big responsibility and a 12 year old boy and 12 year old girl is not ready to take on the responsibility of raising a baby nor can they afford one.