Was Rayquaza there when AZ shot the ultimate weapon in Kalos?
As Akashin said, even if it was, it clearly didn't do anything about it, which makes sense as the actual beam only took a moment to ascend and then descend. However, the likelihood of it being in that specific area, which is explicitly far away from the domain that it usually protects, at that specific moment, seems incredibly small.
Like others have said, it's highly possible that each region's world-ending catastrophes is contained within its own universe.
There really isn't any reason to believe so, especially since later games often refer back to those events. Off the top of my head, I can recall a Plasma grunt in BW talking about the schemes of Teams Rocket and Galactic, as well as the former Teams Aqua and Magma grunts in B2W2 talking about their past goals. And then there's the foreign Team Rocket grunt from HGSS appearing in BW.
That said, the supposed god Pokemon Arceus, and perhaps Rayquaza to a certain extent, have less of an excuse.
Arceus is a divine nap-taker that hardly anyone knows about, and even most of those that do don't even know it's name.
Rayquaza has only ever concerned itself with the safety of the Hoennese people, and even then, it has always been drawn in by something else. Either a conflict between the Primal Reversions throwing the local weather out of balance prompted it to appear and deal with it (and that doesn't necessarily have to be for the sake of humans; Rayquaza certainly wouldn't want its world to be destroyed either), an incoming meteor has attracted it (and in a manner similar to how the Rayquaza in
Destiny Deoxys only attacked Deoxys because the meteor that it came in on plowed through its territory and seemed to be a threat, Rayquaza may still have just been looking out for itself/its territory), or it has been deliberately compelled to appear by a Draconid Lorekeeper.
Yeah, about the dimensions. I'm just splitting it into eight dimensions for now. One where Red and Gold happened. One where Blue and Silver happened. One where Ruby, FireRed, Pearl, HeartGold, and White 1 and 2 happened. One where Sapphire, LeafGreen, Diamond, SoulSilver, and Black 1 and 2 happened. One where Yellow, Crystal, Emerald and Platinum happened followed by Black 1 and 2. One similar to the last one only with White 1 and 2 happening. One where X and AlphaSapphire happened. And finally, one where Y and OmegaRuby happened.
I'm being pedantic here, but actually, Diamond and Pearl are incompatible with any universe in which Black and White take place, as are Ruby in Sapphire with any universe that contains Black 2 and White 2. In BW, Cynthia referred back to seeing a "Trainer who faced Giratina," which only happened in Platinum. Likewise, B2W2 contain a reference to Mirage Tower, and also feature a former Team Magma grunt and a former Team Aqua grunt who have become a couple, and they both refer to their past attempts to alter the environment (and it was only in Emerald that both Teams were antagonistic and aimed to alter the ecosystem; in RS, the opposite Team existed solely for the purpose of undermining the villainous Team). So, in order to be totally consistent, then the multiverse would have to look like this:
R/G/B(/Y) > G/S/C
FR/LG and R/S > HG/SS and D/P
FR/LG and Emerald > HG/SS and Platinum > BW > B2W2 (As once the Black and White pairs are added, the Hoenn and Sinnoh adventures
have to be the ones seen in Emerald and Platinum, respectively.)
OR/AS > X/Y
... and then you would split
those up however you see fit.