When I was a protestant, I participated on several occasions in emergency baptisms of infants, in each case using sugar water by cutting open an IV bag and pronouncing the trinitarian formula.
My intention was to join the child to the Church and to the people of God, at the time I was quite ignorant of baptismal theology. I relied on my own baptism for authority.
I was always told, afterwards, that I did the right thing and that these baptisms were efficacious.
By the way, emergency baptisms are always moments of high drama, when Heaven is joined to earth. It’s hard to imagine that, properly performed, that they are not valid due to lack of theological sophistication. The Father sees the heart.
Ans then you have baptism of desire, and perfect contrition, in which Rome allows for regeneration preceding baptism, if it takes place at all.
And in Acts 10, Peter simply told them:
“To him give all the prophets witness, that through his name whosoever believeth in him shall receive remission of sins. While Peter yet spake these words, the Holy Ghost fell on all them which heard the word. And they of the circumcision which believed were astonished, as many as came with Peter, because that on the Gentiles also was poured out the gift of the Holy Ghost. For they heard them speak with tongues, and magnify God. Then answered Peter, Can any man forbid water, that these should not be baptized, which have received the Holy Ghost as well as we? “ (Acts 10:43-47)