I'm actually planning on going in depth on this topic sometime. When Link makes the deal to get Majora's Mask for the Happy Mask Salesman a timeloop begins. Even if Link let's the moon collide into Termina without playing the Song of Time, time automatically resets with Link in the Clock Tower and the Happy Mask Salesman asking if Link found Majora's Mask.
The Song of Time enables Link to take full control of manipulation of time, allowing him to slow it down, speed it up, and also reset to the Dawn of the First Day if he'd like.
A lot of people think MM is a game that could have mutiple endings in which Link died, but this isn't true. Time is looped so that Link cannot fail. With every reset, whether it's intentional or the automatic one, it prevents the destruction of Termina from being an actual outcome.
So if Hylia is the Goddess of Time, which we don't know for sure, but Hylia atleast was associated with time, this opens up the possibility that Terimina and Hyrule have deities in common, and maybe the whole of the Zelda Multiverse does have common deities?