It can be done. Everything has a web interface on it these days. Cameras, printers, even our security system.
I would imagine you would allow the website to call scripts on your the machine that interacted with hardware. You would have to set the permissions correctly in your browser, however.