There are two different ways to look at this question.
- On the one hand, outside of the Church there is no salvation (known in Latin as "extra ecclesiam nulla salus", that is an opinion that has been ratified through Council and Creed and it is still true).
- On the other hand the teachings related to "Baptism of desire/Baptism of blood" muddies the waters considerably.
Unfortunately, "extra ecclesiam nulla salus" is a bit less clear than the cut-and-dry "if you don't die Catholic, you're damned." The last man to try to get away with this was actually in a major, public way was a Fr. Feeney at the beginning of the 20th century. He, and his followers ("Feeneyites"), were excommunicated in 1953 for a strict and literal interpretation of this doctrine.
The following is an excerpt of the letter which was sent to Fr. Feeney explaining the limits of salvation and how it can apply to those inside and outside of the Church (Emphasis mine):
Now, among those things which the Church has always preached and will
never cease to preach is contained also that infallible statement by
which we are taught that there is no salvation outside the Church.
However, this dogma must be understood in that sense in which the
Church herself understands it. For, it was not to private judgments
that Our Savior gave for explanation those things that are contained
in the deposit of faith, but to the teaching authority of the Church.
Now, in the first place, the Church teaches that in this matter there
is question of a most strict command of Jesus Christ. For He
explicitly enjoined on His apostles to teach all nations to observe
all things whatsoever He Himself had commanded (Matt. 28: 19-20).
Now, among the commandments of Christ, that one holds not the least
place by which we are commanded to be incorporated by baptism into
the Mystical Body of Christ, which is the Church, and to remain
united to Christ and to His Vicar, through whom He Himself in a
visible manner governs the Church on earth.[The baptized get first place... no shock there]
Therefore, no one will be saved who, knowing the Church to have been
divinely established by Christ, nevertheless refuses to submit to the
Church or withholds obedience from the Roman Pontiff[People *knowing* that Church is God's Church cannot be saved if they refuse to follow here (also not a surprise)], the Vicar of
Christ on earth.
Not only did the Savior command that all nations should enter the
Church, but He also decreed the Church to be a means of salvation
without which no one can enter the kingdom of eternal glory.
In His infinite mercy God has willed that the effects, necessary for
one to be saved, of those helps to salvation which are directed
toward man's final end, not by intrinsic necessity, but only by
divine institution, can also be obtained in certain circumstances
when those helps are used only in desire and longing. This we see
clearly stated in the Sacred Council of Trent, both in reference to
the sacrament of regeneration and in reference to the sacrament of
penance (<Denzinger>, nn. 797, 807).[Basically, "we know that people are spared if, for some reason beyond their control are unable to get to confession before death"]
The same in its own degree must be asserted of the Church, in as far
as she is the general help to salvation. Therefore, that one may
obtain eternal salvation, it is not always required that he be
incorporated into the Church actually as a member, but it is
necessary that at least he be united to her by desire and longing.
However, this desire need not always be explicit, as it is in
catechumens; but when a person is involved in invincible ignorance
God accepts also an implicit desire, so called because it is included
in that good disposition of soul whereby a person wishes his will to
be conformed to the will of God.
If you want an analogy from literature, in the book The Last Battle, there is a Calermine soldier who "worships Aslan by another name" who gets to go to the "new Narnia." The thought is that, given the option this man (and real men like him) would have actually worshiped God properly.
All things considered, it is quite possible that God has created some "great baptismal font in the sky" which gives all the opportunity, in their last breath, to repent and be saved. I don't know how likely that is, but it is not incompatible with orthodox thought. I will also say that the clear teaching of the Church is that purgatory cannot be avoided without the sacraments.
A final note is that the Church is purposefully vague about who, exactly, is in hell. We are not even willing to condemn Judas outright. The most we can say is that there will be more than one person (according to the mystics it is quite a few more than two, but that is not infallible) in hell because scripture uses the plural form, but, unlike Dante, we cannot say who or how many there are.