Can I factory reset a non-rooted pixel 2 with a bad digitizer?
As the Pixel 2 supports OTG, you should be able to attach a usb mouse to it to navigate through the menu. You will need an OTG cable for this, which is available for a small price in your favorite shop if you don't have one yet.