The Church Permits Prayers for the Dead for Everyone.
The Catholic Encyclopedia makes this clear:
“There is no restriction by Divine or ecclesiastical law as to those of the dead for whom private prayer may be offered – except that they may not be offered formally either for the blessed in Heaven or for the damned. Not only for the faithful who have died in external communion with the Church, but for deceased non-Catholics, even the unbaptized, who may have died in the state of grace, one is free to offer his personal prayers and good works; nor does the Church’s prohibition of her public offices for those who have died out of external communion with her affect the strictly personal element in her minister’s acts. For all such she prohibits the public offering of the Sacrifice of the Mass (and of other liturgical offices); but theologians commonly teach that a priest is not forbidden to offer the Mass in private for the repose of the soul of any one who, judging by probable evidence, may be presumed to have died in faith and grace, provided, at least, he does not say the special requiem Mass with the special prayer in which the deceased is named, since this would give the offering a public and official character.”