>>51207375Yes, Pokemon Bank will still work with both legally bought 3DS games (cartridge or eShop) as well as any pirated Pokemon games that you've installed. I've successfully transfered Pokemon from an injected version of Omega Ruby to Pokemon Bank and those Pokemon have been transferred to HOME.
Poketransporter (the app that's used to transfer Pokemon from gen 5 games and the Gameboy VC titles) also works with injected VC titles as far as I'm aware, although I haven't personally tried this yet. For gen 5 transfer, it doesn't work with ROMs that you've saved onto your SD card, it only works with legit gen 5 cartridges as far as I'm aware.
You can also install an app called PKSM which allows you to modify save data and transfer Pokemon between any gen 3-7 game installed on the 3DS. This is probably the easiest way to transfer Pokemon from gen 3-5 to Pokemon HOME. Transfer the Pokemon from the older gens to a gen 6/7 game using PKSM, then transfer it to Pokemon Bank, then you can transfer it to HOME and the Switch games.
Also another word of warning: the GTS is now completely unusable in gen 6/7 due to hacked trade listings. It will crash your game if you try to go on it. So the only trading you'll be able to do is locally.