As we see in a number of places, an oath to transgress a mitzvah is invalid from the beginning because it contradicts the oath taken at Sinai to observe hashem's commandments. Rambam and others state that there is a difference between an oath (shvua) and a neder. An oath does not cancel the oath he took at Sinai as it applies to the person. A neder applies to the object and he is forced to have the neder annulled.
One should also note the difference between a neder to not use a particular succah and one to refrain from using any succah
OUTLINES OF HALACHOS FROM THE DAF NEDARIM 16 is too long to copy all of it but here are a few points.
1.(Mishnah): A stringency of Nedarim over Shevuos is that if one said 'Konam Sukah, I will not make one' or similarly regarding Lulav, or
Tefilin, he is forbidden. Such a Shevuah does not forbid, for one
cannot swear to override Mitzvos.
2.(Rav Gidal): "Lo Yachel Devaro." - one may not profane his own word, but he may for the sake of Hash-m's word (an oath to transgress a
Mitzvah is void).
Rambam (Hilchos Nedarim 3:6): A Neder is Chal (takes effect) on
Mitzvos like on Reshus (optional matters). (Note not a shevuah)
- Radvaz: A Neder is Chal to desist from a Mitzvah of action. A Neder to eat pork is not Chal. We do not say that the Aseh "Motzei Sefasecha
Tishmor" overrides a Lav, for he brought the Aseh upon himself.
Shulchan Aruch (YD 215:1): A Neder is Chal on Mitzvos. If one said
'Konam Sukah, I will not sit (in one), a Lulav, I will not take one',
he may not sit in a Sukah or take a Lulav.
Rema: Some say that we lash him for vowing to Mevatel a Mitzvah, and
permit it, and he fulfills the Mitzvah. Some say that there are no
lashes for a vain vow, only for a vain oath.
Shulchan Aruch (5): A Neder is Chal on a Mitzvah only regarding an
Aseh, whether or not there is a Lav for being Mevatel it.
Shulchan Aruch (6): Some say that the Neder is Chal. If he eats it, he
transgresses "Lo Yachel." However, if he was Matfis something else in
it, it is not forbidden, for he intends for the initial Isur, which is
Davar ha'Asur. However, if something is forbidden mid'Rabanan and he
forbade it through a Neder and was Matfis something else in it, it is
forbidden.
Rambam Nedarim 3:6-7
6 What is meant by the statement that vows take effect with regard to
mitzvot as well as actions that are left to one's choice? When a
person says: "Matzah is forbidden to me on Pesach night," "Dwelling in
a sukkah on that holiday is forbidden to me," or "I am forbidden to
take hold of tefillin," they are forbidden to him. If he ate matzah,
dwelled in a sukkah, or took tefillin, he is liable for lashes.11
Similar laws apply in all analogous situations. Needless to say, one
who says: "I am obligated to bring a sacrifice if I eat matzah on
Pesach night," is obligated to bring a sacrifice.12 Similar laws apply
in all analogous situations.
11. For breaking his vow. The Rama (Yoreh De'ah 215:1)
mentions a view that maintains that the person should be given
corporal punishment for taking such a vow and should be compelled to
ask to have the vow released.
12. For he can fulfill the mitzvah and bring the
sacrifice (the Rambam's Commentary to the Mishnah, Nedarim 2:2).
7 Why do vows take effect with regard to mitzvot and oaths do not take
effect with regard to mitzvot? Because when a person takes an oath he
forbids himself from [partaking of] the entity mentioned in the
oath.13 When, by contrast, one takes a vow, he causes
the entity mentioned in the vow to be forbidden to
him.14 Thus when a person takes an oath to nullify a
mitzvah, he is placing a prohibition upon himself and he is already
bound by an oath [to observe that mitzvah] from Mount Sinai, and one
oath does not take effect if another is already in effect. When, by
contrast, a person causes an entity to be forbidden through a vow, the
prohibition involves the entity itself and that entity is not under
oath from Mount Sinai.
13. I.e., the prohibition involves the gavra, the
person himself. It cannot take effect if he is already bound to act
otherwise.
14. I.e., the prohibition involves the cheftzah, the
article. Once it is forbidden, it is forbidden to fulfill the mitzvah
by partaking of it or using it, for a positive commandment does not
supercede a negative commandment. It would be a mitzvah fulfilled
through a transgression which is a forbidden act (the Rambam's
Commentary to the Mishnah, loc. cit.).