Your understanding is correct - there is no UK Prime Minister until one is appointed by the Queen. In the meantime, the Civil Contingencies Act (2004) gives the Monarch (in practice, government ministers) powers to make emergency regulations, and COBRA meetings can be chaired by any Cabinet minister - after 9/11, these were chaired by the Cabinet Secretary until the PM could attend himself.
The Queen will appoint as PM the person most likely to command the confidence of the House of Commons. In practice, this is the person chosen as the leader of the party with the most MPs - in this case, the party that the deceased PM previously led. How this is chosen, and how quickly, will depend on the party in question, although in these circumstances it seems likely that an interim leader would be speedily chosen. The Labour Party's rules for this are described in Steve Melnikoff's answer here. In the case of the Conservative Party, their constitution states under Schedule 2 - Rules for the Election of the Leader that:
Upon the initiation of an election for the Leader, it shall be the
duty of the 1922 Committee to present to the Party, as soon as
reasonably practicable, a choice of candidates for election as Leader.
The rules for deciding the procedure by which the 1922 Committee
selects candidates for submission for election shall be determined by
the Executive Committee of the 1922 Committee after consultation of
the Board.
If there is only one candidate at the time laid down for
the close of nominations, that candidate shall be declared Leader of
the Party.
It would be possible, then, for MPs to be strongly encouraged to only nominate one candidate in order to conclude this process as quickly as possible, without a full membership vote. You may remember in 2016, for example, Andrea Leadson withdrew from the leadership contest leaving Theresa May as the sole candidate, which meant that there was no ballot of the party membership.
In the specific case you raise, however, Foreign Secretary Dominic Raab was given the role of 'Designated Survivor' on March 22nd, and will carry out Johnson's duties that he can't perform himself while he is affected by the virus. It should be noted that this role is not an official post, and if Johnson were to die from the virus then it is not a given that Raab would be appointed leader of the party and therefore the new PM. In fact, the article notes that this designation was challenged by some in the Cabinet, who thought that the Chancellor of the Duchy of Lancaster, Michael Gove, should have been given the role, and indeed; Gove replaced Johnson at the daily press briefing on March 27th. Another contender might be Jeremy Hunt, against whom Johnson won the Conservative Party leadership election in 2019.
As for other Westminster systems, there is no blanket answer to that question. It is perfectly possible for a bill to be introduced that immediately designates the new Prime Minister on their death, as in the US system. Indeed, in 2013, Peter Bone MP introduced the Prime Minister (Replacement) Bill, which contains the following provision:
In the event of the death or incapacitation of a person holding the
title of Prime Minister and First Lord of the Treasury, the title,
salary and functions of that role shall be conferred upon another
Secretary or Minister of State in accordance with the following order
of precedence—
- (a) person bearing the designation of Deputy Prime
Minister;
- (b) Secretary of State with responsibility for Home Affairs;
- (c) Secretary of State with responsibility for Defence;
- ...
This bill did not make it onto the statute books, but it proves the point that it is possible for an order of succession to exist in a Westminster system.