What about people who have never heard of Jesus?
The Bible says God is just and that he judges fairly, and it also says there is a reason Christians are told to go and tell. Christians disagree on some details, and the right posture is trust in God's justice.
This question assumes that God is unfair, and the Bible would say it's the other way around: he is entirely fair, and we are the ones who aren't in a position to judge.
Here's what Scripture says. God has made himself known to everyone in creation and conscience (Romans 1:19-20, 2:14-15), and people everywhere have in some way turned from what they know. So no one is simply innocent. And yet God is described as patient and merciful, not wanting anyone to perish (2 Peter 3:9). Abraham's question in Genesis 18:25, 'Shall not the Judge of all the earth do what is just?', is answered yes.
Some Christians believe that salvation always comes through the work of Jesus, and that a person must hear and respond to be saved. Others hope God may reach some who never hear the gospel, but through Christ alone, not another way. The Bible doesn't spell out the answer in detail, and thoughtful believers differ.
What is clear is the command that follows. If the message is good news, then the people who have it should take it, which is why missionaries have crossed the world. The Bible doesn't present this question as a loophole. It presents it as a reason to go.
If you leave this one unresolved, you're in good company. You can trust that the God who gave his Son is better than you at caring about the people you're worried about.
Read it for yourself
Genesis 18:22–25
Abraham Intercedes for Sodom
22 So the men turned from there and went toward Sodom, but Abraham still stood before the LORD. 23 Then Abraham drew near and said, “Will you indeed sweep away the righteous with the wicked? 24 Suppose there are fifty righteous within the city. Will you then sweep away the place and not spare it for the fifty righteous who are in it? 25 Far be it from you to do such a thing, to put the righteous to death with the wicked, so that the righteous fare as the wicked! Far be that from you! Shall not the Judge of all the earth do what is just?”
Romans 1:18–20
God’s Wrath on Unrighteousness
18 For the wrath of God is revealed from heaven against all ungodliness and unrighteousness of men, who by their unrighteousness suppress the truth. 19 For what can be known about God is plain to them, because God has shown it to them. 20 For his invisible attributes, namely, his eternal power and divine nature, have been clearly perceived, ever since the creation of the world, in the things that have been made. So they are without excuse.
Romans 10:13–15
13 For “everyone who calls on the name of the Lord will be saved.”
14 How then will they call on him in whom they have not believed? And how are they to believe in him of whom they have never heard? And how are they to hear without someone preaching? 15 And how are they to preach unless they are sent? As it is written, “How beautiful are the feet of those who preach the good news!”
2 Peter 3:9
9 The Lord is not slow to fulfill his promise as some count slowness, but is patient toward you, not wishing that any should perish, but that all should reach repentance.