God is not bound by sacraments. God can choose to do whatever He wills. Afterall, what is happening in a sacrament? God is acting through the sacrament. God can certainly forgive, transform, and act in any way He chooses outside of the sacraments.
Of course, if we wanted to apply a sacrament to this situation we could argue that the “good thief” received baptism of desire but in this situation it hardly seems necessary since he had a direct interaction with Jesus.