Go therefore and make disciples of all the nations, baptizing them in the name of the Father and of the Son and of the Holy Spirit. (MATTHEW 28:19)
When Jesus came to earth, He knew exactly what He had to do. He had a ministry and a plan. Jesus wasn’t preaching very long before He called his 12 disciples to join Him. Jesus’ message to the people was that He was God and that He was the promised Savior, the one who would save the people from their sins. Jesus preached to the people but also taught His 12 disciples in a special way. After three short years, Jesus was crucified. But before He died, He told His disciples He would send them a Helper (the Holy Spirit)—and He said to go into all the world and preach the gospel.
His plan is for people to take the gospel throughout the world. The Helper would give wisdom and courage to continue teaching in Jesus’ name. They did receive that wisdom and courage and continued to share the good news about Jesus. They taught more and more people . . . and those people taught more people . . . and Christianity spread to many nations.
So the answer to your question really is that although Jesus only preached in the Middle East, His word is still spreading today as He commanded to happen. The Apostles—the word means “messengers”—took the gospel to the rest of the world because Jesus commanded to take it to Jerusalem, Judea, Samaria, and to the ends of the earth. So the message of salvation came from Jesus, and He commanded it should be spread to the whole planet.