As long as the Pokémon are recognized as a non-glitch Pokémon in Emerald, and are not holding certain glitch items (some glitch items will be accepted, others will be rejected, but I haven't actually attempted to migrate a glitch item; it's on my to-do list), it should be fine. The game's hack check is extremely lax, and, while I haven't tested it, the only conflict I can imagine the game would call you out for is illegitimate Mew/Deoxys, in which case the game probably just rejects the Pokémon by saying "This Pokémon cannot migrate." Illegitimate movesets (even those containing a glitch move, which can sometimes turn into a Gen 4 or 5 move depending on its ID no.) migrate just fine, and the only time the game will reject a Pokémon is if it detects glitched data (IE, data that does not correspond to any intentional Pokémon/item/etc.), which it isn't even all that great at finding, since a lot of glitch data makes it past the check anyway.
I haven't tested how capable Gen 5's hack check is (or if it even has one), but after that, Pokebank is the only way to transfer Pokémon to later generations, and I'd imagine Pokebank's check is many times more thorough than Gen 5's. However, even Pokebank's hack check isn't perfect, and as long as it is technically possible to obtain a Pokémon via legitimate means, it should go through just fine. I've done a bit of research into the Battle Factory glitch, and it sounds like you're just keeping Pokémon that are supposed to be rentals. These Pokémon should have no problem going through, since all the Battle Factory Pokémon have legitimate movesets.