Here's my ten cents.
Ash ended up in Ultra Ruin because Tapu Koko/Shiny Tapu Koko used the same move, at the same spot in spacetime in their respective universes. It's a recurring plot device in Japanese science fiction that that you can shift between parallel worlds by creating an invisible line between them, and that line is usually some kind of synchronized action.
Dia is the grown-up Ash from the alternate dimension
As a lot of people picked up on, Dia is probably the grown up version of the Ultra Ruin Ash-clone, and Zeraora is Pikachu's counterpart. There are several hints to this:
-his main Pokemon is an electric type
-Zeraora has the same pet peeve of electrifying anyone who annoys him (shown by Pikachu earlier in the episode to remind the audience)
-Zeraora knows Quick Attack, which along with Flame Charge is a pseudo signature move of Ash that he teaches to multiple Pokemon he owns that can learn it
-flashback Dia has SM Ash's pants, but Red's black undershirt and a solid red, pocketless vest (which no prior art has exactly)
-in the flashback, young Dia also owned a Litten
-he is a member of the Ultra Rangers (equivalent to the Ultra Guardians), with red colouration
-his hat is identical to the one in the flashback
-the hat resembles SM Ash's, but with a filled in logo and a white bill
-the old picture of the Pokemon School features counterparts of the current class, and young Dia stands in the front
-he is voiced by Yamadera Koichi, who is usually reserved for important characters (legendaries or main villains) in the movies
Of course, most of this could be disproven next episode: perhaps the young Ash clone merely left the island, and the Dia relationship is a red herring. This is a heavy possibility if only because it's strange that this is "the future" of the current timeline in Alola, wouldn't it make more sense to be around the same time?
Anyway, I would wager that Dia has lost his way or given in to despair at never beating Guzzlord, and Ash was brought her to give him some inspiration (and Z-Crystals). We'll see!
I hope I wasn't the only one to think of this when I saw it!