“There is salvation in no one else; for there is no other name [Jesus] under heaven that has been given among men by which we must be saved.” Acts 4: 12.
The question always is this. What about those who have never heard nor ever will hear the name of Jesus? The questioner usually is thinking of uncivilized people in some remote area of the earth, unvisited by Christian missionaries.
I believe God is certainly aware of those kinds of situations and that He has made provision for such people. Furthermore, I believe He has done it in three ways without violating the above scripture.
Firstly, God has placed the evidence for the knowledge of Himself within all.
Secondly, there is the proof of His invisible attributes and eternal power that are seen in nature and in the order of the universe. Romans 1: 18-20.
Thirdly, right from wrong can be determined by the Law God has placed within the heart. Romans 2: 15.
As a result, those who haven’t heard the Gospel know that there is a Creator God. They acknowledge God and honor Him in their conscience and actions. They instinctively do the things of the Law. This is the light they have in their hearts, and they walk in that light. Romans 2: 14, 15.
The fact that they never heard of, nor will hear of Jesus, is not held against them. I know this because this situation is addressed in Proverbs 24: 12. There, the writer says, “If you say, ‘See we did not know this,’ does He [God] not consider it who weighs the hearts? And does He not know it who keeps your soul? And will He not render to man according to his works?”
The explanation that allows God to save these people without violating Acts 4: 12 is this. Though they’ve never heard the name Jesus; they know, accept, and worship God. They believe in Him. As such, their faith is credited to them as His righteousness (Gen. 15: 6; Hebrews 11: 7).
They think of God as their Creator; and because Jesus is the Creator, it is Jesus, after all, by whom they’re saved.
Scripture remains unbroken.