An interesting question and one which the New Testament addresses in a number of ways. The fundamental question is: “What is necessary for salvation?
Since salvation is a gift of God, God can give it to anyone He wants to. Human actions cannot control God. “God will have mercy on whom He will have mercy.” But …. The New Testament is very clear that God now commands us all to “repent, be baptized and receive the gift of the Holy Spirit.” So, if we refuse to follow God’s command, if we refuse to be baptized, “how can we escape if we neglect so great a salvation”? Thus, it seems very unlikely that God will save someone who refuses to be baptized. But, if it is physically impossible for someone to be baptized (e.g., because of a medical condition), then God can, in His great mercy, still extend salvation to that person.