This is how I understand it: "Ei" here is linked to "îi"; it's an optional element in terms of grammatical correctness/ completeness of the sentence. Its function is to specify (or reinforce) that the person to whom the dress is being offered is female, not male (in which case it would be "Lui îi oferi..."). I believe the position at the beginning of the sentence is optional; it could also be placed after the verb ("Nu îi oferi ei o rochie nouă.").
Check out the original grammar explanation by Duolingo: https://www.duolingo.com/skill/ro/Dative-Pronouns. Note: "Ei" as we first learn to use it means "They" (when it refers to the subject of a sentence, i.e. when "they" are doing an action) - this is the nominative case. But there is a second use of "ei", namely in the dative case (when "ei" is not acting, but rather the action is happening to the respective person). Here it refers to a single female person other than you and me, i.e. in these sentences you would translate it as "to her". (In everyday language, the "to" is often omitted, just as in Duolingo's English translation of the sentence above! Don't let that confuse you!)
The link from Efalc doesn't work on mobile... Try this one: https://www.duolingo.com/skill/ro/Dative-Pronouns/tips-and-notes