That is inaccurate. There may have been some isolated cases, but not as a general rule and practice.
Canon law forbids the baptism of any child without the consent of the parents.
What did happen was that many children who were orphans were adopted by Catholic families and raised as Catholics. These were baptized.
Others were never legally adopted, but were raised as Catholics, nonetheless to protect their identity and they were baptized. But these were children whose parents’ whereabouts were unknown.
Also, people like John XXIII and John Paul II who were young men at the time falsified many baptism certificates and changed family names to allow these individuals to escape.
Someone mentioned whether Maximilian Kolbe acted individually or with Church authority. The answer is simple. Maximilian Kolbe was a Franciscan Friar. The Superior General of the Franciscans had authorized the friars to act on behalf of the Jews in any way possible. He even went as far as to create the Assisi Underground at the Franciscan Generalate in Assisi.
Also, Maximilian Kolbe was the Superior of the friary where he was stationed. He took his orders from his Superior General, who is the equivalent of a bishop and he gave orders to the friars under his jurisdiction.
Therefore, the orders to act came from above.
At the time John XXIII was an Archbishop and an abassador to France. He authorized the French clergy to join the underground. These orders also came from above.
John Paul II was a seminarian. His bishop allowed his seminarians to act. These orders also came from above.
The Holy Father knew that all of these bishops and religious superiors were allowing and encouraging such actions, even violating Church law to do so and he looked the other way. He gave his tacit approval of their actions by keeping silent, even when Church law was broken. For example, you cannot falsify a document of baptism, ordination or religious vows. This is what was done on behalf of many Jews. Many passed as priests and religious with certificates of ordination or religious profession of vows. Children passed with certificates of baptism, all falsified.
JR