Can a pushbutton be connected between a digital input and a digital output ?

Every one starts somewhere ...