If we read the context, I think it is takingtalking about getting baptized for Jesus if Jesus were dead and not resurrected. The context is that Paul was talking about the direct relationship between Jesus' resurrection and the resurrection of the dead, because there were some people who were thinking that resurrection of the dead does not happen. The reason Paul was giving is, if resurrection of the dead doesn't happen then Jesus is also not resurrected, and if Jesus is not resurrected then what they are doing is in vain, including baptising for dead people such as Jesus.
1 Corinthians 15:16-29
16 For if the dead rise not, then is not Christ raised:
17 And if Christ be not raised, your faith is vain; ye are yet in your sins.
18 Then they also which are fallen asleep in Christ are perished.
19 If in this life only we have hope in Christ, we are of all men most miserable.
20 But now is Christ risen from the dead, and become the firstfruits of them that slept.
21 For since by man came death, by man came also the resurrection of the dead.
22 For as in Adam all die, even so in Christ shall all be made alive.
23 But every man in his own order: Christ the firstfruits; afterward they that are Christ's at his coming.
24 Then cometh the end, when he shall have delivered up the kingdom to God, even the Father; when he shall have put down all rule and all authority and power.
25 For he must reign, till he hath put all enemies under his feet.
26 The last enemy that shall be destroyed is death.
27 For he hath put all things under his feet. But when he saith all things are put under him, it is manifest that he is excepted, which did put all things under him.
28 And when all things shall be subdued unto him, then shall the Son also himself be subject unto him that put all things under him, that God may be all in all.
29 Else what shall they do which are baptized for the dead, if the dead rise not at all? why are they then baptized for the dead?