Generations 1 & 2 (Gold, Silver, and Crystal) are the only Generations that can't connect to Generations 3 (Ruby, Sapphire, and Emearld, and the Generation 1 remakes Fire Red and Leaf Green) through 6 (X, Y and Gen 3 remakes Omega Ruby and Alpha Sapphire) currently..
though Generation 3, 4 (Diamond, Pearl, platinum and the Generation 2 remakes Heart Gold and Soul Silver), 5 (Black and white and their sequels Black 2 and white 2), and 6 can transfer Pokemon but it's only one way transfer. You won't be able to place a Pokemon back into the previous Generation it was previously in.
So far with Gen 7 (Pokemon Sun and Moon) the storage service called Pokemon bank that was released during Generation 6 can't connect to generation 7 but it will eventually be able to early next year along with the Generation one Virtual consoles on the 3ds. Items however will need to be regained since they are not transferable in any Gen to Gen transfer.
There are a few side games that are able to connect to the main series. The main two being the Gamecube games called Pokemon Coliseum and XD Gale of Darkness. Although these two games can only connect to Generation 3 with a certain GBA-to-Gamecube cord but the Pokemon obtained from them can be transferred into generation 6 and eventually 7.
That should be everything with the connectivity between the Pokemon games and the generations unless I'm forgetting something lol
Currently the connectivity looks like..
Gen 1 -> Gen 2 -/> Gen 3-6
Gen 3 (XD and Coliseum are "Gen 3" games) -> Gen 4 -> Gen 5 -> Gen 6
But it'll look like..
Gen 1 (through Virtual console) -> G7
And Gen 3 all the way up to G7