Several research papers explore how Android devices can interact with USB connections to execute code or automate tasks, often framed within security vulnerabilities:
"USBIPS Framework: Protecting Hosts from Malicious USB Peripherals"
You have a car head unit running Android. You want that when you plug in a specific USB drive with music, the car automatically opens PowerAmp and starts playing. Tasker on that head unit makes this 100% possible.