The order of the baptisms can go either way.
The outpouring at Pentecost - Acts chapter two - AFTER
"Gladly received his word" = believed the Gospel = were saved = received the Holy Spirit
The believers in Samaria - Acts 8:14-17 - AFTER
"Believed Philip" = believed the Gospel = were saved = received the Holy Spirit
The disciples in Ephesus - Acts chapter nineteen - AFTER
"That they should believe on Him" = believed the Gospel = were saved = received the Holy Spirit.
After that Paul his hands upon them. This was not usual, and it was to enable them to speak in tongues and prophesy. It could be because before this they had not heard of the Holy Ghost and they needed to witness the power of the Spirit.