If a girl and a girl have sex, can they get pregnant?
Without some help...no.
In order for a pregnancy to occur, the first thing you need is a sperm and an egg. Individuals who are biologically female are going to be able to provide the ovum (or egg) while individuals who are biological male are going to provide the sperm. So if you have two individuals who are biologically female, you're going to be missing one things necessary to create a pregnancy (namely, sperm). Two eggs won't make a pregnancy, even if you could get them together (which wouldn't happen on its own anyway since ova don't come out of women the way sperm do from men). Though it is wise to remember that any sort of sex between individuals (no matter what their sex or gender) can have STI risks associated, so it is still important to think about protection.
If two women who are both biologically female want to create a pregnancy, they can do so but it will require some assistance. A sperm donor (whether that is someone the couple knows or a donor chosen from a sperm bank) would be needed. The women can then decide how they wish to go about trying to become pregnant. Generally this involves one of three options. They can either have one partner have intercourse with a man, try self insemination or seek the assistance of a medical professional to do a procedure like intrauterine insemination (IUI) or invetro fertilization (IVF). Each option has risks and benefits that the couple would want to weigh before deciding how to go about the process.
Also, if we are talking about two people who both identify as female but may not be biologically female, then a pregnancy could result if they have sexual contact. Gender is a concept that is both fluid and something that is constructed. If one (or both) of the individuals identify as transgendered, transexual, genderqueer, etc., while one has biologically female reproductive organs and the other has biologically male reproductive organs, then it would be possible for a pregnancy to result from sex in that case.
For more information, you may want to check out: