In theory it should be possible to run two parallel instances of MAME, assuming that you have different inputs mapped etc. However I have never tried it, and there might be reasons (bad coding or other dependencies unknown to me) why it isn’t possible.
However I have tried that exact thing with the SEGA M2 emulator…