There can be several causes for this to include BIOS, software, malware and wireless keyboards.
"Safe Mode" is a troubleshooting mode designed to start Windows with minimal drivers and running processes to diagnose problems with your computer. If you have a wireless keyboard, and your BIOS does not natively support it, then the device drivers for the keyboard need to load for it to function. And since starting a computer in Safe Mode prevents many drivers from loading, you are unable to enter into it since your keyboard does not function if the proper drivers do not load. Try using a PS/2 keyboard - a keyboard with a cable that plugs into the back of your PC.
Also there are times when the wireless transmitter and receiver fail to make contact with each other and need to be reset or require battery replacement.
For more suggestions see Situations in Which Windows May Not Start in Safe Mode
and the Community Newsletter: Where has Safe Mode gone