There is a disagreement among the Rishonim as to the order of lighting Shabbat and Chanukah candles on Erev Shabbat Chanukah.
The Ba’al Halachot Gedolot (commonly referred to as “Behag”) is of the opinion that Chanukah candles must be lit before Shabbat candles because women customarily accept upon themselves the sanctity of Shabbat by lighting the Shabbat candles and were they to light Shabbat candles first, they would then be unable to light Chanukah candles thereafter. Clearly then, Chanukah candles must be lit first. This opinion is quoted by the Tur.
Although we have a rule that the more common of two Mitzvot must be performed first, for instance, in Kiddush of Friday night the “Ha’Gefen” blessing precedes the blessing of “Mekadesh Ha’Shabbat” because it is more common (as explained in the Gemara in Berachot 51b), so too, in our case, Shabbat candles are lit more often than Chanukah candles (which are lit only eight nights a year); would it not follow that Shabbat candles be lit first? Rather, according to this opinion, since it would not be possible to light Chanukah candles after Shabbat candles because lighting Shabbat candles constitutes an acceptance of Shabbat, the Chanukah candles must indeed be lit first.
On the other hand, the Ramban and the Rashba disagree with the Behag’s opinion and they maintain that lighting Shabbat candles in no way constitutes an acceptance of Shabbat, and since this woman, and everyone else for that matter, has in mind to light Chanukah candles after lighting the Shabbat candles, according to all opinions she has not yet accepted Shabbat. Thus, they rule that one should first light Shabbat candles and only then light Chanukah candles, based on the rule of performing the more frequent of two Mitzvot first.
Halachically speaking, the ruling on this matter follows Maran Ha’Shulchan Aruch who writes that a woman’s lighting of Shabbat candles does not constitute an acceptance of the sanctity of Shabbat, especially if she has in mind to perform work afterwards, for instance, lighting Chanukah candles and the like, in which case she certainly has not yet accepted Shabbat. This applies all the more so regarding the husband of this woman, who is usually the one to light the Chanukah candles, in that he has not accepted Shabbat on the basis of his wife’s lighting of the Shabbat candles. It would then seem that the Halacha should follow the ruling of the Ramban that Shabbat candles should indeed be lit first.
However, the Radbaz writes that even though we maintain that one does not accept Shabbat by lighting Shabbat candles, since there is a dispute amongst the Rishonim regarding this matter in addition to the fact that the Mitzvah of lighting Chanukah candles is more beloved, it is therefore proper to light Chanukah candles first, even against the rule of the more common Mitzvah coming first. Similarly, Maran Ha’Bet Yosef writes that even according to the opinion of the Ramban and the Rashba that Shabbat candles should be lit before Chanukah candles, one may still light whichever one he chooses first.
Summary: On Erev Shabbat Chanukah, one should preferably light Chanukah candles and only then light Shabbat candles. However, if one accidentally lit Shabbat candles first, one may in fact light Chanukah candles afterwards, for according to the Sephardic custom, one does not accept Shabbat by lighting Shabbat candles. Even according to the Ashkenazi custom that one does in fact accept Shabbat by lighting Shabbat candles, nevertheless, a husband surely does not accept Shabbat through his wife’s Shabbat candle-lighting, as we have already mentioned, and he may still light Chanukah candles with a blessing.