Each game you want to hack would probably need some reasonably involved hacking to achieve it.
As a proof of concept I would probably look at
https://gbatemp.net/threads/release-game-hacking-for-learn-with-pokemon-typing-adventure.480825/
It was a hack to replace the keyboard bundled with the game with a PC and commands sent over network. No reason you could not do something similar with any other game, indeed we saw various control hacks for many games.
Alternatively if the network thing is not for you you could probably wire up either a GBA slot device to take input from a PC, or maybe a DS slot device similar to the pokewalker thing (not sure what the latency of the save slot protocol is here).
For some idea of what control hacking would entail then
https://web.archive.org/web/20110604163902/http://crackerscrap.com:80/docs/sfchacktut.html .
Even with the GBA slot thing you would still have to hack games individually -- the DS does not have enough of a firmware/always on OS type setup going on to direct things at that level so each game handles its own business however the dev instructed it to do it.
You could rip apart a DS and tap into the debug points and wire that back to a PC easily enough and it would work for every game that uses the dpad and buttons (possibly touchscreen as well but other than simple "is pressed" it would be more effort). That would however need a specially wired up DS to play it whereas a hacked ROM would do wherever you could get a PC and network setup to do it.
For the effort though I would sooner use an emulator.