The above still assumes a well-mixed population, but with heterogeneous susceptibility (using the terminology from [1]). There's also heterogeneous connectivity (i.e., the fact that some people have more social contacts than others), which further reduces the herd immunity threshold.
To be clear, the above is a fake example. We know that almost no one has perfect pre-existing sterilizing immunity to the novel coronavirus, because we've seen highly-connected populations (homeless shelters, slums, boats, etc.) where almost everyone tested positive. But that doesn't mean everyone is equally susceptible! Immunity is a continuum, not a binary thing, and the 20-50%[2] of people with reactive T cells very likely get less sick given the same initial viral dose (or, stated in the other direction, would need a greater viral dose to get equally sick). They also might spread the virus less, though that's more speculative.
Finally, I'll note that the herd immunity threshold is the point where R becomes < 1, and the number of people currently infected starts to shrink instead of growing. People still get infected on the downslope, so the fraction of people infected can overshoot higher (and potentially much higher, especially if no precautions are taken to slow the spread).
1. https://www.medrxiv.org/content/10.1101/2020.07.23.20160762v...
2. https://science.sciencemag.org/content/early/2020/08/04/scie...
We don't actually know that. Even if some significant % of the population has pre-existing sterilizing immunity, then by chance we'd still expect to have many groups of people where everyone is vulnerable.
Of course non-sterilizing immunity could still be incredibly valuable. They're speculating that the current vaccine candidates may not cause sterilizing immunity[1], but immunity that turns a fatal illness into a bad cold (or a bad cold into a couple of sniffles) is great, whether naturally pre-existing or from a vaccine.
1. https://www.statnews.com/2020/05/22/the-world-needs-covid-19...
Note that true R0 is a concept I made up on the spot. I think it is clear what I mean but experts in this may have better terms.