I have never heard of any controller being reprogrammed, but some people have removed the controller chip and replaced it with wires to their own controller.
This usually requires
lots of wires: one for each row and column, and also the indicator LEDs. I suggest using ribbon cables as much as possible to avoid something looking like a rat's nest. Most people modding keyboards with plate-mounted switches even remove the PCB completely and replace it with "direct wiring": diodes and wires soldered directly to switches.
If the keyboard is not too unusual, however, you could possibly create a "protocol converter" (active adapter) that converts its protocol to USB ... and program your custom stuff into
its firmware. That is often much easier hardware-wise.
There are several free firmwares available for microcontroller boards based on the ATmega32u4 microcontroller: from e.g. AT and PS/2, XT, IBM terminal, first Macintosh, Apple ADB, Wyse and Next ... even USB to USB.
You will find these in the
Making Stuff Together! subforum. (This thread should have been in that subforum in the first place ...
)
The most common firmware is Hasu's "TMK" firmware collection which includes firmwares for both keyboards and converters.
The most common microcontroller boards are the Teensy 2.0 and the Arduino Pro Micro. The latter is open hardware so there are lots of cheap clones on eBay.