“Else what shall they do which are baptized for the dead, if the dead rise not at all?” 1 Corinthians 15:29.
A misunderstanding of the Apostle Paul’s words has led to the concept of a substitutionary baptism: Christian people, whose friends had died without baptism, were baptized for them representatively. Correct views of the meaning of real baptism can quickly clarify the matter. One person could no more consecrate himself for another person than he could transfer either his natural or his spiritual life to another person.
The Apostle's topic was the resurrection of the dead, and he is here elaborating on the resurrection. Evidently, some had lost faith in this doctrine. In the verse 29, he calls our attention to the fact that believers had all been baptized, and that their baptism symbolized death. To show the inconsistency of the new position, Paul asks where would be the value of a consecration to death, as their baptism suggested, if the new theory that the dead rise not at all were true? They had consecrated themselves to be members, to die with one another, and one for the other in fellowship with Christ, and thus to be dead with him. And as members of Christ’s body, members of the great atonement sacrifice on behalf of the dead world, they did this in the hope of the promised resurrection.
The Apostle's argument is that the whole Christian position stands or falls together. If there is no resurrection of the dead, then those who are fallen asleep in Christ are perished, as well as the remainder of the world. If such is the case, and there is no future hope either for the Church, or for the world through the Church, why should we consecrate our lives unto death? We are baptized into death with Christ, baptized for the dead, to the intent that we may be associated with Jesus as the Life-giver of the world–the Seed of Abraham.
So, can a church do baptism for the dead according to 1 Corinthians 15:29? Yes, the Biblical church-the body of the Christ-is baptized for the dead. The church baptizes herself for ministering to the world in the future. We hope to assist our Lord in the restoration process of the hearts of mankind to bring them back to full fellowship with God (Isaiah 31:33,34). This will happen after the dead are resurrected in the days of restitution (Acts 3:19-21). Please look for more questions/answers about restitution under the topic: Salvation, Ransom and Restitution.