Baptism, which corresponds to this, now saves you, not as a removal of dirt from the body but as an appeal to God for a good conscience, through the resurrection of Jesus Christ (1 Peter 3:21).
Baptism corresponds to escaping through water in that the water of baptism is in some way a counterpart to the waters of the flood. For if, as is nearly certain, baptism when Peter wrote was by immersion (going completely under water-note how incongruous the mention "removal of dirt from the body" would be if Peter thought that only a few drops of water were sprinkled on the head), then going down into the waters of baptism was a vivid symbol of going down into the grave in death ("we were buried therefore with him by baptism into death," Rom. 6:4).
The water of baptism is like the waters of judgment-similar to the waters of the flood, and showing clearly what we deserve for our sins. Coming up out of the waters of baptism corresponds to being kept safe through the waters of the flood., the waters of God's judgment on sin, and emerging to live in "newness of life" (Rom. 6:4). Baptism thus shows us clearly that in one sense we emerge from the waters knowing we are still alive and have passed through the waters of God's judgment unharmed. As Noah fled into the ark, so we flee to Christ, and in him we escape judgment.
Adapted from Wayne Grudem's commentary on 1 Peter