Fetching details from the dictionary...
(if) by some chance; by some possibility; in the unlikely event that; 10000 to 1
(unlikely event of) emergency; the worst(-case scenario)
万が一に備えて保険に入った。
I got insurance in case of the unlikely event.
万が一の時のために非常食を用意した。
I prepared emergency food just in case.
万が一事故が起きたらすぐに連絡してください。
If by any chance an accident occurs, please contact us immediately.