Our Gemara on Amud Aleph discusses a scenario where one makes an oath forbidding entry into a home. A distinction is made between whether the person uses the language of “this home“ or “your home.“

If he uses the term “your home“ emphasizing that the home is in possession of this person, if owner of the house dies or sells the house to another, it is permitted for the one who took the vow to enter the house, as it is no longer in the possession of the prior owner. But if he said: Entering this house is konam (forbidden as a sacrifice) for me, then even if the owner dies or sells it to another, it is forbidden.

The Ran raises a point that there also may be a leniency in regard to the use of the phrase “this house”. If the house fell, and had to be rebuilt, since it no longer is the same house, it should now be permitted. However, Rashba (Gittin 22a) disagrees; he holds that “this house” is a catch all term, and is not taken literally as only this house, but any structure on location that will be this house is included in the oath.

The Chida (Ahavas Dovid 9:59) quotes a Ritva who supports the Ran and argues with the Rashba,  and he brings a proof from a well known verse in Tehilim (95:11) which we say Friday night in Kabbolas Shabbos:

אֲשֶׁר־נִשְׁבַּ֥עְתִּי בְאַפִּ֑י אִם־יְ֝בֹא֗וּן אֶל־מְנוּחָתִֽי 

Concerning them I swore in anger,“They shall never come to My resting-place!”

Vayikra Rabbah (32) comments on this verse:

As I swore with my mouth, If they come to my resting place. Indeed, they will not come to this resting place, but they will come to another resting place. This can be compared to a king who became angry with his son and made an oath that he will not benefit from his palace. Look at the Kingdom? He destroyed his palace and then rebuilt it, so as now his son can enter with the rest of the folk into the new palace.

This seems to be adequate proof that if the oath is made specifying a possessive form, “this palace”, to destroy it and rebuild it under different ownership is no longer prohibited by the oath.

The Chida tries to defend the interpretation of the Rashba as follows. The Mishkan and the first and second Beis HaMikdash were built under human hand and auspices. Therefore, in effect, it was not really God’s house but the people's house. This is analogous to the marital state of Eirusin Betrothal where the wife is still not fully in her husband’s domain, living by her parents. However, the third temple, which is going to come down from heaven, is going to be completely in God’s domain and therefore have a different owner and even different structure, and therefore even Rashba would agree that it is not subject to the oath. Just as Nisuin, the final stage of marriage, is accomplished when husband and wife live together in their own domain. Messianic times will be considered as the final stage of connection to God, metaphorically the completion of the Heiros Gamos, The heavenly marriage. Since that is a new house it will not be bound under the oath.