No. In the case of Cornelius and his family, the whole family received the Holy Spirit before they were baptized. This proves that baptism is merely a symbolic act representing a repentant spirit. And since Cornelius and his family were already repentant, the Holy Spirit fell upon them before they went through the symbolic ceremony of baptism.
The key here is that you must be broken and contrite in your own spirit (have a repentant spirit) before you can receive the Holy Spirit.
Acts 10:30-33 & 44-48 – 30 Cornelius answered: “Three days ago I was in my house praying at this hour, at three in the afternoon. Suddenly a man in shining clothes stood before me 31 and said, ‘Cornelius, God has heard your prayer and remembered your gifts to the poor. 32 Send to Joppa for Simon who is called Peter. He is a guest in the home of Simon the tanner, who lives by the sea.’ 33 So I sent for you immediately, and it was good of you to come. Now we are all here in the presence of God to listen to everything the Lord has commanded you to tell us.”.
34 Then Peter began to speak: “I now realize how true it is that God does not show favoritism 35 but accepts from every nation the one who fears him and does what is right. 36 You know the message God sent to the people of Israel, announcing the good news of peace through Jesus Christ, who is Lord of all. 37 You know what has happened throughout the province of Judea, beginning in Galilee after the baptism that John preached— 38 how God anointed Jesus of Nazareth with the Holy Spirit and power, and how he went around doing good and healing all who were under the power of the devil, because God was with him.
39 “We are witnesses of everything he did in the country of the Jews and in Jerusalem. They killed him by hanging him on a cross, 40 but God raised him from the dead on the third day and caused him to be seen. 41 He was not seen by all the people, but by witnesses whom God had already chosen—by us who ate and drank with him after he rose from the dead. 42 He commanded us to preach to the people and to testify that he is the one whom God appointed as judge of the living and the dead. 43 All the prophets testify about him that everyone who believes in him receives forgiveness of sins through his name.”44 While Peter was still speaking these words, the Holy Spirit came on all who heard the message. 45 The circumcised believers who had come with Peter were astonished that the gift of the Holy Spirit had been poured out even on Gentiles. 46 For they heard them speaking in tongues and praising God.
Then Peter said, 47 “Surely no one can stand in the way of their being baptized with water. They have received the Holy Spirit just as we have.” 48 So he ordered that they be baptized in the name of Jesus Christ. Then they asked Peter to stay with them for a few days.
We also see this with the thief on the cross. He was not baptized, but he expressed sincere repentance by declaring Jesus as an innocent King. He was referring to Jesus as the Messiah in this way. In turn, Jesus said he would be accepted in paradise! We don’t need much more confirmation than that folks!
Luke 23:40-43 – But the other one rebuked him, saying, “Do you not even fear God, since you are under the same judgment? 41We are punished justly, for we are receiving what our actions deserve. But this man has done nothing wrong.” 42Then he said, “Jesus, remember me when You come into Your kingdom!”43And Jesus said to him, “Truly I tell you, today you will be with Me in Paradise.”