There is a line of succession - but it applies only to the monarch, not to members of her government, or to Parliament.
In the event of a catastrophe as described in the question, the first priority would be to unambiguously determine who the monarch now is.
Assuming that can be done*, the British monarch can then use her reserve powers. Normally, these are only exercised by the monarch on the advice of the government; but we can imagine that in a crisis, the monarch could use them alone, or on the advice of civil servants or others.
In particular, the monarch can appoint ministers, so she could immediately appoint a Prime Minister, who could then advise her on who else to appoint.
Similarly, she can also appoint peers (i.e. members of the House of Lords), and in the absence of the Commons (see below), it would make sense for all new ministers to be made members of the Lords.
The Commons is more complicated. Prior to the Fixed Term Parliaments Act 2011, the monarch had the power (on the advice of the PM) to dissolve Parliament and hold fresh elections. In a crisis like this, that would be very useful. However, that power is now held solely by the Commons, which obviously couldn't use the power if the Commons didn't exist.
Since the Lords can't change this on their own, one option is to just wait for the current Parliament to expire. If the crisis happened near the end of its 5-year term, that might be feasible; but if not, there may not be an alternative. Note that if a vacancy arises during a parliamentary term, a by-election is authorised either by the Commons if it's not in recess, or by the Speaker on the request of two MPs if it is. Clearly in this case, neither of these options would be possible.
Finally, the Civil Contingencies Act 2004 gives broad powers to the government in the event of a major crisis like this. Those powers include the power to temporarily amend (almost any) legislation. So it may be possible to change the law to allow an immediate general election.
(* It gets more complicated if, for example, the monarch is incapacitated and unable to carry out her role. The Regency Acts cover the appointment of Counsellors of State, or a regent, to act as monarch temporarily; however, in a crisis like this, the only people authorised to make this decision may themselves be incapacitated. In the absence of a strictly legal way forward, pragmatism may have to take over - e.g. the next person able to be regent becomes regent without being formally appointed.)