When we first meet him, Doctor Strange, using the Eye of Agamotto (which contains the Time Stone), defeats Dormammu.
In Thor: Ragnarok, Ragnarok occurs after Surtur destroys Asgard under Odin's disgraced daughter Hela. Thor and Loki then confront Thanos's Sanctuary II while trying to help the refugee Asgardians.