The Holy Spirit gave Cornelius the ability to speak in tongues before he was baptized. Does this show that one does not need to be baptized in order to be saved?
No, for several reasons.
First, Jesus said specifically that baptism is required for salvation (Mk. 16:16). So did Peter, the apostle who was speaking to Cornelius at the time the Spirit fell on Cornelius and gave him the miraculous ability to speak in tongues (1 Pet. 3:21; cf. Acts 2:38).
Secondly, Peter later said concerning the Holy Spirit and Cornelius, “As I began to speak, the Holy Spirit fell on them just as on us at the beginning” (Acts 11:15). Take note of “As I began to speak…” If one reads Peter’s discourse to Cornelius in Acts 10:34-43, it is clear that Peter shared the good news about Jesus and the salvation he offers to all with the Gentile. Yet the Holy Spirit fell on Cornelius as Peter BEGAN to speak. Peter started his discourse by speaking of God showing no partiality (Acts 10:34), with no mention of Jesus as of yet. If the Holy Spirit giving Cornelius the ability to speak in tongues indicates that Cornelius was saved, then Cornelius would have been saved before he could have actually heard anything about Jesus. Since “faith comes from hearing, and hearing through the word of Christ” (Rom. 10:17), then Cornelius would have been saved before he could have acquired faith in Christ. That would contradict John 3:16.
Thirdly, while plotting the murder of Jesus, one of Christ’s chief enemies, the high priest Caiaphas, prophesied about the death of Jesus without knowing it. As recorded by John:
John 11:45-53 (ESV)
45 Many of the Jews therefore, who had come with Mary and had seen what he did, believed in him,
46 but some of them went to the Pharisees and told them what Jesus had done.
47 So the chief priests and the Pharisees gathered the Council and said, “What are we to do? For this man performs many signs.
48 If we let him go on like this, everyone will believe in him, and the Romans will come and take away both our place and our nation.”
49 But one of them, Caiaphas, who was high priest that year, said to them, “You know nothing at all.
50 Nor do you understand that it is better for you that one man should die for the people, not that the whole nation should perish.”
51 He did not say this of his own accord, but being high priest that year he prophesied that Jesus would die for the nation,
52 and not for the nation only, but also to gather into one the children of God who are scattered abroad.
53 So from that day on they made plans to put him to death.
Take note that Caiaphas “did not say this of his own accord” as he “prophesied that Jesus would die for the nation” (v. 51). This is because “no prophecy was ever produced by the will of man, but men spoke from God as they were carried along by the Holy Spirit” (2 Pet. 1:20-21). Thus, we have a record of the Holy Spirit giving the spiritual gift of prophecy to someone who clearly was not saved. Such was the same with Cornelius and his family.
The reason the Holy Spirit fell on Cornelius and his family before their baptism (Acts 10:44-48) is given in Luke’s account of Peter’s re-telling of the event to his fellow Jews:
Acts 11:15-18 (ESV)
15 As I began to speak, the Holy Spirit fell on them just as on us at the beginning.
16 And I remembered the word of the Lord, how he said, ‘John baptized with water, but you will be baptized with the Holy Spirit.’
17 If then God gave the same gift to them as he gave to us when we believed in the Lord Jesus Christ, who was I that I could stand in God’s way?”
18 When they heard these things they fell silent. And they glorified God, saying, “Then to the Gentiles also God has granted repentance that leads to life.”
Jesus had planned that the gospel would first be proclaimed to the Jews in Jerusalem, and then in all Judea and Samaria, and finally to the Gentiles worldwide (Acts 1:8b; cf. Lk. 24:47; Rom. 1:16; Acts 3:26; 13:46-48). The first seven chapters of Acts show how the gospel was proclaimed in Jerusalem, and chapters 8-9 show how it then spread throughout Judea, Samaria, and Galilee. Starting with Cornelius and his family, now the Gentiles would be recipients of the good news. In order to make this clear to the Jews, whom any serious study of the New Testament would show had serious prejudices against the Gentiles, the Holy Spirit in the minutes leading up to their obedience of the gospel gave them the miraculous ability to speak in tongues, just as He had done with the apostles in Jerusalem on the day of Pentecost at the beginning (cf. Acts 2:1-4).
However, the Spirit giving them this ability for this reason would not negate their need to still be baptized into Christ for the forgiveness of their sins in order to receive the salvation offered by God’s grace, as that is part of Jesus’ plan also.