For any reasonably-imaginative child, there will never be an end to the "what if" scenarios!
Sometimes it's just a game, like "who would win in a fight between Chuck Norris and a Charizard?" (Chuck Norris, clearly, because he has Great Balls.) In this case you can make your answers as ridiculous as you like. Eventually they'll get tired of the joke and move on.
Sometimes it's genuinely about finding out about the world, and assuming that (as an adult) you'll know the answers. If you do know, then great. If you don't, it's never too early to tell a child that you don't have all the answers, in which case you have an opportunity to show what basic research looks like, and hit Wikipedia or Google. That has the double benefit of not just finding the information, but also putting a delay on the next "but what if..." which has a good chance of them losing focus and going onto something else.
There is a negative version though. My niece is currently having some issues with anxiety, and one of the ways that plays out is catastrophizing. "What if (insert worst-case scenario)?", in other words. Parent provides reasons why that can't happen, or solutions against it. "But what if (insert another worst-case scenario preventing that working)?" Rinse and repeat until the scenarios get more implausible. We don't think she is anxious because she actually believes the worst-case scenarios she's thinking up; we think the anxiety is there generally, and these scenarios are her trying to justify that anxiety. At some point her parents have to step in and say "enough", because talking yourself down a rabbit-hole of negative thoughts is not a good thing. Having been clinically depressed myself, I'm personally aware of how negative ideation can affect you, so stopping that spiral is good.
There's a further possibility too, which is that the child has a genuine and well-founded concern, and one they aren't mentally prepared to deal with. Most obviously right now, "what if Putin nukes us?" In this case it may be necessary to flat-out lie to them, because they don't have the mental resilience to handle the truth that there are some "what-ifs" which we just can't do anything about.