Pokemon Bank can trade through X and Y, Omega Ruby and Alpha Sapphire, Sun and Moon, and Ultra Sun and Ultra Moon. If you have the Poke Transporter application downloaded with it as well, it can also trade between Black and White, Black 2 and White 2, and the Virtual Console releases of Red, Blue, Yellow, Gold, Silver, and Crystal. Do note however that Pokemon taken from an earlier game to a new game will not be able to go back to their original game (so a Pokemon from Omega Ruby transferred to Moon would not be able to go back to Omega Ruby)
Tl;Dr: this flowchart has it all:
Hope this helped!