Similarities with Dormammu:
.Both are cosmic demons who have corrupted many people into becoming evil.
.Attempted to destroy their universes and torture everyone in them (Invictus has actually tortured people multiple times in the series).
.Both take on the appearance of demonic head (though with Invictus is it's astral form)
(Big one).Both have killed the main protagonist multiple times (Invictus killed other Gary's from different timelines, whereas Dormammu killed Strange multiple times when in a loop).
Similarities with Sauron:
.Both are ancient evils, whose main goal is to kill/conquer the entire world (universe in Invictus' case).
.Both have been known to corrupt people into becoming evil by using want they desire (mostly a lust for power), even including more noble people (Ash Graven for Invictus, and Saruman for Sauron)
.Both were originally defeated and sealed away but it only applied to their main bodies, and were secretly causing mayhem even when imprisoned and through their minions.
(Really big one).Both take the form of a giant eye when in their weakened/imprisoned forms.
.Both try to get their minions to steal away something they have created to help them escape their imprisonment (e.g Mooncake who was created after the breach between Final Space was closed and is a crucial tool in escaping his prison, and the One Ring which Sauron created to give him more power and one of his ultimate goals is to retrieve it so it can escape and conquer all of Middle Earth).
.Both can take on a fiery appearance when in their weakened forms (e.g Invictus' astral form and fiery form)
.Both made one of the protagonist's allies betray them (Ash Graven who completely betrayed Gary due to thinking he killed her brother and Invictus' influence on her, and Boromir who was temporally corrupted by the Ring (though he snapped out of it and quickly became remorseful of what he had done)).
.Both managed to take control of of the main protagonists mind for a short while (e.g Gary when Invictus took control of his body before taking over Avacato's body and the One Ring (which was created by Sauron) took control of Frodo as he was about to destroy it).
.Both were implied to have been forces of good before subverting all of their positive traits and becoming pure evil (Invictus is heavily theorized to have been a fallen being of unimaginable light, whereas Sauron was indeed confirmed to be a force of good before subverting all of it (at least in the books)).