There are dozens of strains of HPV, and the chance of someone not having a single one of them is, imo, pretty low. How many kids have warts (caused by HPV)?
The issue is that the vaccine won't do any good if the recipient already has one of the HPV strains contained in the vaccine. It only contains antigens from four strains of HPV. It will not protect against other strains, nor will being infected with one of the other strains affect its effectiveness against the target strains.
It does make a lot of sense to test prior to vaccination. Ideally, a person could be tested and then given a designer vaccine to protect against strains they do not have but are likely to encounter.
HPV causes a lot more than cervical cancer. There are several cancers associated with HPV, and pretty much everyone is susceptible to them.
There’s never been any manufacturer’s statement warning about adverse effects of being vaccinated while infected. There’s no danger in being vaccinated while infected other than that the previous infection won’t be prevented.
The 4 strains cause nearly all the problems with genital HPV in the US. Two of the strains (16,18) cause 70-80% of cervical cancer and precancerous changes. There is some evidence of cross-protection from strains other than the ones in the vaccine.