The RNG for the 3DS pkm games is 128 bit (SFMT) so it allows for any combination.
Gen5's RNG is 64bit, not 2*32bit. There was also a Mersenne Twister which was responsible for IVs (regular pkm; wondercards used the aforementioned PIDRNG).
Legality is based on whether or not the chance of getting that result is possible within the period of the RNG (time before it repeats). Since the period is orders of magnitude larger than the chance of getting a pkm combination, any combo is valid.