G'day all!
I just wanna speak from my experience regarding the 'randomness'.
From my experience, it does not seem random at all, but rather pre-determined!
Since I play the same town with 2 devices, I tried buying a Box to see what I got. Then I'd access my town with the 2nd device (which will negate the Box I just bought), & try buying the Box again. I tried this method about 10 times on the Medieval MB & about 5 times on this 4th of July one. I consistently got the SAME item for both, Castle of Equalia (Medieval MB) & Retro Lard Lad (4th of July MB).