Android support USB HID devices like keyboard and mouse.
If you have a USB-C keyboard, or connect via a USB hub. The USB keyboard will have control to the system, without on-screen confirmation.
I see it is a security risk that public USB charger might have potential access. Even the USB connection mode is "charge-only".
A hacker might have a USB hub, and add a HID to control your phone with a idle delay.
Back to by question.
It there a way to disable that at all at OS level? If there is no way to have a "pairing confirmation" like BT devices have.