Can a USB keyboard be used as input for an arduino

You would need a USB Host shield for that with the standard configuration and some coding.

If that's an option, use an old PS2 keyboard instead. There is a library to support that connection

see PS2Keyboard Library, Connect a keyboard for user input