Someone asked R Shlomo Aviner that question regarding traveling on the roads of the West Bank which some certainly consider dangerous.
He writes one can travel to places where the danger is uncommon (Rabbi Kook, Mitzvat Re’eiyah 3:17)
We must to distinguish between cases of “harm being common” (Pesachim
8b), where we have to be cautious, and cases of “harm not being
common,” where we need not be cautious.
We must distinguish between justified fear and exaggerated fear,
otherwise we are liable to sit in fear day and night doing nothing.
Incidentally he reminds us this is actually a very old question.
At the end of the Kuzari [written in ca. 1140], the King of the
Khazars asks the scholar: “Why are you going to Eretz Yisrael? Surely
the trip there, involving travel over land and by sea, is fraught with
danger?” The scholar responds, “It is no different from the merchant
who travels far in hope of earning a profit.”
For instance regarding traveling to the West Bank and Israel, there have been 88 casualties from terrorism in all of Israel (not just the West Bank) between 2012-2016 compared with 1633 from road accidents. As such terrorism falls into the harm not being common category.
See here for further halachic proof based on the distinction between a high-probability danger and a low-probability danger, and on the idea one can take a small risk if traveling for a mitsva.