The Noda Beyehuda (YO"D 210) writes that one may not dissect a Jewish corpse (which is forbidden) in order to discover the cause of death, even if it is the only way to uncover information that will help save lives in the future. He explains:
אבל בנידון דידן אין כאן שום חולה הצריך לזה רק שרוצים ללמוד חכמה זו אולי יזגמן חולה שיהיה צריך לזה, ודאי דלא דחינן משום חששא קלה זו שום איסור תורה או אפי׳ איסור דרבנן, שאם אתה קורא לחששא זו ספק נפשות א״כ יהיה כל מלאכת הרפואות שחיקת ובישול סמנים והכנת כלי איזמל להקזה מותר בשבת שמא יזדמן היום או בלילה חולה שיהיה צורך לזה... וחלילה להתיר דבר זה
Basically, unless there is a חולה who needs it, one cannot transgress any prohibition - even one of Rabbinic origin - on the off chance that it may save lives later.
The Chasam Sofer (Y"D 336) and Binyan Tzion (V1, §137) rules the same. (See also similar ruling in Shu"t R' Akiva Eiger §60, although marginally different)
[This may be the explanation why we are not obligated to all become doctors and learn emergency first aid, although this could potentially lead to saving lives in the future.]
However, the Chazon Ish (Y"D 207.6) writes that the deciding factor is not whether there is an existing חולה, but whether there is a reasonable belief that the action will save lives, and not just the 'off chance':
בפ"ת סי' שס"ג בשם הנו"ב והח"ס דאם יש חולה קמן מותר לנוולו משום פ"נ אבל
אין חולה קמן אסור, ואין החילוק בין איתא קמן לליתא קמן, אלא אם מצוי
הדבר דבזמן שמתריעין עלה [אף שאין בשעה חולה קמן] משום חולי מהלכת הו"ל
כאויבים שצרו בעיר הסמוך לכפר וכדאמר בעירובין מ"ה א' ובתענית כ"א ב',
ומיהו בשעת שלו' לא חשבינן ליה פ"נ אע"ג דשכיח בזמן מן הזמנים שיצטרכו
לזה כמו שאין עושין כלי זיין בשבת בשעת שלו' דא"כ בטלת כל המצות, אלא לא
מקרי ספק פ"נ בדברים עתידים שבהוה אין להם כל זכר, ובאמת שאין אנו בקיאים
בעתידיות, ופעמים שמה שחשבונם להצלה מתהפך לרועץ, והלכך אין דנים בשביל
עתידות רחוקות
Accordingly, if there is a likelihood that the ambulance would be needed, one would be allowed to do anything necessary to make that possible.
(See also Shu"t Machane Chaim [V2 Y"D §60], who writes that the Chasam Sofer and Node Beyehuda were talking specifically about dissecting bodies because of the severity of kovod hames, but would not say this by other prohibitions. In his words:
רק ניכר כונת הנוב"י שחשש פן יחתכו כל המתים ללמוד מהם וגם ניכר כונת
אדמו"ר (החת"ס) כי חשש על דברי הרמב"ן קללת אלקים תלוי וכו)
There are numerous sources where we find dispensations in Halacha משום שלום מלכות, although there was no specific סכנה yet. (See B"K 83a & Beis Yosef YD 178; Rambam Hil. Korban Pesach 3:1 and Kesef Mishne; Sanhedrin 26a [Tos. misherabu])
Summary: According to the pashtus of the Node Beyhuda and Chasam Sofer, it would be forbidden to do something for a future sakanah. However, the Chazon Ish explains that if there is a strong likelihood that this action will help save future lives, it is permitted.