With power off, there's no solution. Basically, if someone was dumb enough to drop a quarter into a machine that's turned off, too bad for them.
But with power on, there is a solution. Some coin mechs come with an electro magnet that when activated will catch the coin. But I don't know much more about this, and I really don't think MAME could control them anyways.