Hacks of this kind are certainly possible. You first have to identify which ROMs the graphics are stored in and what format (bit and byte layout/organization) they are stored in. Then you need to fix any checksums which may exist to make such changes difficult. There may be other complications like fixed palettes and collision detection.
Some of that may be easier if you are able to use the MAME source, or recompile it with custom debugging and tracing.
Possible, yes, but not generically simple unless you are re-implementing a hack someone else has done.