For Catholics, at least, the answer turns on how you interpret the traditional maxim “No salvation outside the Church.” Generally, it’s been interpreted as requiring baptism as a precondition of entry into Paradise.
Enormous debate has ensued over what “baptism” means, though. The notion that there existed just persons who acted in accordance with the Commandmants of the Church but, for whatever reason, didn’t get a chance to be physically baptized with water, gave rise to the notions of “baptism by fire” (i.e., a martyr’s being deemed to be baptized by virtue of his suffering for Christian principles), and “baptism by desire” (the just man who in his heart, albeit perhaps inarticulately, acts in accordance with the Gospel and accepts or would be open to accepting God/Jesus as Savior, but has been denied this chance by accident of where/when he was born, etc.).
You can find a ton of disputation on these topics by searching “baptism by desire” (or the alternative term used for this doctrine, the “good heathen” principle – religious apologetics of olden days being less than hypersensitive in their references to non-Church-members). Essentially the debate was/is about how far baptism by desire can stretch. Optimists/liberals would have it be pretty elastic – from the “Pelagian heresy” onward, they’ve struggled against the orthodoxy to recognize a broad range of opportunities to accept/gain salvation without having much to do with the Church or Church doctrine. Traditionalists want to keep this tendency in check, arguing that taken to an extreme, it negates the importance of the “one true faith” by positing that anyone who’s more or less a good guy, according to his own lights, can get salvation on equal terms with those who receive the sacraments, follow the Commandmants, and participate in the life of the “one, holy, catholic [i.e., universal] and apostolic Church.” (To the extent you believe the orthodox view is sincere, it goes a ways to explaining the oft-criticized emphasis on conversion/proselytizing/missionary activity – a sincere Christian of the traditional view would find himself dismayed by the prospect of far off folk not having equal access to the salvific opportunities of the faith, and could not console himself that the “good heathen” would get a free pass on Judgment Day).
There are a lot of paradoxes here. For instance, if you adopt a pro-baptism-by-desire view, you can find yourself confronting circumstances in which an unbaptized “heathen” might be better off never hearing about the Church – e.g., while a pre-Columbian Indian can’t very well be blamed for not accepting a Christianity he didn’t know about (and instead should be judged on, say, his general conduct), once a culture’s exposed to the surpassing truths of Christianity, there’s no excuse for not availing of the opportunity of explicitly embracing them through physical baptism – and indeed, having the opportunity and rejecting it (say, Muslims) leaves you worse off (a sort of almost heretic) than never having it but achieving it by desire (say, some undiscovered tribe in the Phillipines).
This is a big topic, unfortunately (but perhaps inevitably) polarized (at least in Catholic history, and I’d imagine in other Christian denomination) by politics and factionalism. And this doesn’t even touch on the Mormon beliefs about how souls from olden (pre J. Smith days) can or can’t retroactively gain salvation – a big issue for them, as I understand it.
Here’s what the Catholic Catechism had to say on the subject (which I (no theologian) interpret as embracing a baptism by desire “loophole” but trying to limit it to those who, apart from the accident of non-baptism, believe and act in full accordance with Catholic principles): “Those who die for the faith, those who are catechumens, and all those who, without knowing of the Church but acting under the inspiration of grace, seek God sincerely and strive to fulfill his will, are saved even if they have not been baptized” (CCC 1281; the salvation of unbaptized infants is also possible under this system; cf. CCC 1260–1, 1283).