Ancient Israel practiced baptism as a sign of repentence even before John. The best way to look at the OT is in terms of foreshadowing and prefiguring what was to occur in the NT. The things of the OT are fulfilled in the NT and are always made better in the New Covenant because of Jesus.
The baptism of Jesus makes Christian baptism holy and sacramental in the New Covenant. The OT prefiguring of baptism is best seen by comparing Ezekiel 36:24-28 to Acts 2:37-39. The verses read as follows:
Ezekiel says, “For I will take you from the nations, and gather you from all the countries, and bring you into your own land. I will sprinkle clean water upon you, and you shall be clean from all your uncleannesses, and from all your idols I will cleanse you. A new heart I will give you, and a new spirit I will put within you; and I will take out of your flesh the heart of stone and give you a heart of flesh. And I will put my spirit within you, and cause you to walk in my statutes and be careful to observe my ordinances. You shall dwell in the land which I gave to your fathers; and you shall be my people, and I will be your God.”
The book of Acts says, "Now when they heard this they were cut to the heart, and said to Peter and the rest of the apostles, “Brethren, what shall we do?” And Peter said to them, “Repent, and be baptized every one of you in the name of Jesus Christ for the forgiveness of your sins; and you shall receive the gift of the Holy Spirit. For the promise is to you and to your children and to all that are far off, every one whom the Lord our God calls to him.”
Notice how the verses correspond. In Ezekiel God says He will give you a new heart and put His spirit within you. In the book of Acts it says they were cut to the heart and that they will receive the Holy Spirit. In Ezekiel God says that He will cleanse you from all of your uncleanesses. The book of Acts says that He will forigve your sins. Ezekiel says that You shall dwell in the land which I gave to your fathers; and you shall be my people, and I will be your God. The book of Acts says, that the promise is to you and to your children and to all that are far off, every one whom the Lord our God calls to him.
This kind of prefiguring extends from John’s baptism as well. John was not baptising with the New Covenant baptism and there are no claims of equivalency to be found in scripture that would put John’s baptism on an equal footing with the Trinitarian baptism of the New Covenant. Scripture does make distinctions between John’s baptism and that of Christian baptism. It is clear that in the latter there exists the elements of regeneration and of receiving the Holy Spirit. The baptism of John was never understood in the sacramental sense. It was not a covenant oath by God that would transmit grace, provide the remission of sin, or bring the gift of the Holy Spirit.
I hope this helps.