Adoption was not in common law until quite recently. Some adopted it sooner than others, but the common practice was to have informal adoptions, even with name changes. (Which had no legal standing. The blood parent could lay claim to the child at any time, and no doubt there are a lot of plots in there.)
Civil law had it, from ancient times, but the practice there was chiefly of adopting adult men to continue the family line. (After the same manner as the Japanese, often enough, with any handy daughter marrying the adopted man.) Even if someone took up a foundling to be raised as a child, not a slave, the child remained the offspring of the abandoning parents. (A fact wide exploited to resolve New Comedy plots by revealing the heroine's respectable parentage and so eligibility to marry the hero.) But the legalities were there. A later culture might exploit them.
I decided to have one civil law and one common law country next to the other. Since the heroine fled from the common law to the civil law one, I can finagle her arranging an adoption for the orphan girl. Especially since it's merely a civil law country, not ancient Rome.