IMO the chances of Harris recusing herself so that Pelosi would be president in this highly hypothetical situation is from zero to none. IMHO I think Pelosi getting re-elected as Speaker is just a little greater than 50/50
The only scenario where Pelosi can really become the President is if something happens with elections and Trump’s term expires before public gets to elect the president. But even in that case, Congress is more likely to just elect a president and a VP on their own instead of having Pelosi do the job for 2 years (if Dems hold on the majority and she remains speaker). Congress has elected the president in the past, there is a legal precedent for it. Technically speaking, in case of a dispute, states can appoint electors in electoral college without any elections, so if the public vote goes to crap for some reason, states can intervene on case by case basis and appoint the electors that their local governments feel like they can get away with.
To clarify a bit. Under current law it is impossible for the election to be undecided until after the scheduled inauguration. The electoral college electors must submit their votes by mid-December as attested by the governor's authority. If some states are still counting the popular vote at that time, they either do not submit their EC vote or they submit it under whatever criteria the state legislature has decided. In any case some states (probably most to nearly all) will submit their EC vote and that's what will be counted in early January. If a couple of states do not submit their EC vote then they are just flat out of contention. If for some reason someone does not get a majority of the EC votes submitted, the House selects the president from a, basically, list of the top five EC vote getters. One thing to note is if it comes to a House vote, each state, not each representative, has one vote. Currently Republicans have a majority of the states, though that might change with the new congress installed on January 3.