I am not sure whether this can be done easily. I think that one important point has to be considered: while the GPIO pins are more or less direct connections to the CPU, actual hardware interfaces have their own components that alter signals that are present on the connector. So you do not only have to emulate your device but also parts of the receiving hardware.
As an example:
Let's say you would like to emulate a USB device that you connect directly to the GPIO pins. Real USB devices are not connected directly to the CPU. There is hardware like transceivers and USB controllers and similar either on the mainboard or inside the micocontroller that actually receives the signals. And the result of this "preprocessing" step is then sent to the CPU and to the kernel. In your emulation scenario you would also have to emulate this receiving hardware.
For many applications this can be quite difficult and very low level. And for many it can easily become impossible to do it with an arduino or raspberry pi or similar because of very high frequencies and/or signal speeds. Actual hardware implementations use dedicated chips like ASICs, DSPs or FPGAs to achieve this.