Can a Pennsylvania resident adopt an adult illegal immigrant?

No. First, adoption is a legal process governed by State laws. You cannot petition the Court to make an illegal act legal, or in this case, to ignore the illegal resident status of a person but approve a legal adoption. As another example, in small claims court if Person A sues Person B because Person B sold Person A "bad cocaine", the Judge would dismiss the case because it is illegal to buy cocaine. The Judge could also, as a representative of the Law, report both parties for cocaine use.

Second, adoption is typically reserved for minors, under the age of 18 years old. It may be possible to adopt an adult with severe mental impairment, but that is typically made into a Guardianship, not an adoption.