Yes, this is the teaching of the Church. Baptism, even when administered by heretics, is considered valid. There was a great crisis in the third century in the Church, when Saint Cyprian, a saint from Carthage in North Africa, along with the North African bishops, began to rebaptize people who came from schismatic and heretical groups. However, the Roman Church and the Popes forbade this practice, as the Church had never done it before. When heretics came into the Church, they simply confessed their sins and received the Sacrament of Penance; they were not rebaptized. This was the constant teaching of the Church.
If there are doubts, however, about whether a baptism was valid, a conditional baptism can be administered. For example, if a heretical group such as the Presbyterians used water, the proper material for baptism, and used the correct formula given by our Lord, "I baptize you in the name of the Father, and of the Son, and of the Holy Spirit," that is sufficient. But if there is a problem with the material or the form, and there is a serious and proven doubt, then the Church may permit conditional baptism.
In such cases, we must consult the local bishop or the bishops' conference to determine how the baptism of a specific community, like the Presbyterians, is regarded. The Holy See or some bishops' conferences have compiled lists of Protestant communities whose baptisms are considered valid. This list should be consulted.
I even recall from Church history that the Popes in the fourth century and afterward recognized the validity of baptisms administered by the Arians. Arianism was a heresy that denied the divinity of the Son of God. Still, the Church recognized their baptisms as valid because they used the proper material (water) and the correct Trinitarian formula. As a rule, such baptisms must be considered valid, but in specific cases, the situation must be carefully examined. If there is serious doubt, a conditional baptism may be administered.
Dear visitors of Gloria Dei and all who have already written or who will write a personal message to me. I am grateful for your attention, your kindness, for your spiritual support and especially for your sacrifices and prayers for me. God may reward you!