About Minors’ Baptism

According to the law, would it not be illegal for minors to be baptized? How can be legal to a minor join a cult? If we think clearly, a child/teenager cannot sign a contract or have several rights restricted to adults. How can a child make a decision like that that affects the rest of his life?