You are not understanding Acts 10 nor are you understanding Acts 2:38.
The gift (singular, not gifts) of the Holy Ghost in Acts 2:38, is the Holy Ghost or Spirit itself which everyone receives upon baptism, and NOT the gifts obtained by or through the Spirit, those listed in 1 Cor 12:8-10, that were miraculously manifested upon the laying on of the apostle's hands such as was done in Acts 19 after the Ephesians were re-baptized into Christ after which Paul laid his hands on them in order for them to receive the gifts, plural (not the gift of the Holy Ghost). After doing so, they spoke in other tongues and prophesied.
The miraculous nature of the falling of the Holy Ghost in Acts 2 and 10 was unique and not the norm, as a sign to the Jews in 2 and a sign to Peter and his company in Acts 10, for the purpose of heavenly validation in order to justify what was occurring. In both instances the church got it's start, 1st in Jerusalem amongst the Jews as noted in Acts 2, and in Caesarea amongst the Gentiles as noted in Acts 10. These are the only 2 instances noted in the bible where the Spirit fell this way enabling the gifts prior to the laying on of the apostle's hands.
I suggest YOU study this carefully.
In Acts 2:38, "for the remission of sins" does not refer back to both clauses, "you all repent" and "each one of you be baptized," but refers only to the first. Peter is saying "repent unto the remission of your sins," the same as in Acts 3:19. The clause "each one of you be baptized" is parenthetical. This is exactly what Acts 3:19 teaches except that Peter omits the parenthesis.
These Gentiles in Acts 10:43-47 had already
believed, received the gift of the Holy Spirit and spoke in tongues (spiritual gift which is only for the body of Christ - 1 Corinthians 12)
BEFORE they were water baptized in verse 48.
In Acts 19:2, Paul asked them if they had
received the Holy Spirit when they believed and their answer in verse 3
reveals that had not yet believed in Jesus unto salvation. They had received the baptism of John but
did not realize that Jesus Christ was the One to whom John's baptism pointed. Paul gave them instructions about Jesus and
after they believed Paul's presentation of the gospel and came to saving faith in Christ, they were then baptized in the name of the Lord Jesus. Paul laid hands on them to receive the Holy Spirit (which was not the case in Acts 2 and Acts 10, exception not the rule).
Although the miraculous sign gifts that occurred in Acts 10 did validate to the Jews that God has accepted the Gentiles, this still does not change the fact that these Gentiles,
believed, received the gift of the Holy Spirit, spoke in tongues and were saved BEFORE receiving water baptism. I have already studied this carefully.
So the evidence is overwhelming that these Gentles believed, received the gift of the Holy Spirit, spoke in tongues, magnified God, and were saved and a part of the body of Christ
before they were water baptized. Certain Jews may have wanted to forbid them from being baptized because of their unacceptance of the Gentiles, but Peter clearly states that SURELY NO ONE CAN REFUSE. These Gentiles were clearly SAVED BEFORE WATER BAPTISM and the Holy Spirit was proof of this.
Romans 8:9 - But you are not in the flesh but in the Spirit, if indeed the Spirit of God dwells in you. Now if anyone does not have the Spirit of Christ, he is not His. If one has received the Holy Spirit they "belong" to Christ. To belong to Christ does not describe the condition of a lost unbeliever but a saved believer - such was the case of these Gentiles
before they were water baptized.
1 John 4:13 - By this we know that we abide in Him, and He in us, because He has given us of His Spirit. Because they received the Holy Spirit, these Gentiles abided in God and God abided in them. To abide in God and to have God abide in you does not describe the condition of a lost unbeliever but a saved believer - such was the case of these Gentiles
before they were water baptized.
We do not receive the gift of tongues, which is only for the body of Christ (1 Corinthians 12:4-12), without first receiving the gift of the Holy Spirit (indwelling, regenerating presence of the Holy Spirit). We don't receive "a" gift of the Holy Spirit until we first receive "the gift of the Holy Spirit" and these Gentiles clearly received the gift of the Holy Spirit
before they were water baptized.