I've come across this sentence in Jisho.org. In many English grammar books, it's said that で is used instead に when ある marks the location of an event, as in こんばんジムの家でパーティーがあります. Why is it に used here then?
東京にいつ激しい地震があるか誰にもわからない
You can find examples with で though.
From a similar thread,
イラクで戦争がある。≒ イラクで戦争が起こる。
The ある means 起{お}こる, 発生{はっせい}する, 行{おこな}われる (meaning #12 in goo辞書)
Compare:イラクにXXがある。(= There's XX in Iraq.)
イラクでXXがある。(= XX occurs/takes place/will be held in Iraq.)