Short answer: Sure
Longer answer: exactly how is this "physical button" going to be connected to your system? That will determine how to perform I/O with it.
RS-232 has always been a Pop Favorite. USB might also be a good choice. There are lots of other alternatives, too.
PS:
Q: How do you think a mouse button works? Or a joystick?
PPS:
Have a look at
D-Bus, too: