We have a few equally valid possibilities here.
It’s possible that the thief on the cross (Luke 23:40-43) was baptised before he was crucified. It’s also possible that Jesus made an exception for the thief because the opportunity for baptism was not present.
However, Jesus’ clear instruction to us is “Whoever believes and is baptized will be saved” (Mark 16:16); and when some people in the Book of Acts realised they had sinned against God they asked Peter what they must we do to be saved, and he replied “Repent and be baptised” (Acts 2:38). In fact, if you read through Acts it becomes clear that every new believer was baptised. So the instruction is clear enough, even if the Lord is willing to make exceptions in some circumstances. The point is, Jesus has the authority to allow an exception but, if the opportunity for baptism arises, we don’t.
There is another possibility, too: baptism is symbolic of dying with Christ and destroying our old way of life (Rom. 6:3-6); the thief on the cross, more than anyone else, did this because he did it literally when he was crucified with Christ.