Others held that it is classified with the voluntary prayer, since it is not obligatory by the original ruling of the Sacred Law; thus, it is valid inside the Ka'bah.
This ruling concerns an unrestricted vow, where the person making the vow says: “For Allah’s sake, I vow to pray two units of prayer.”
As for a vow specifically tied to the Ka'bah, it is valid to fulfill it there—for example, if he says: “For Allah’s sake, I vow to pray two units of prayer inside the Ka'bah.” His prayer inside the Ka'bah is then unquestionably valid (1), because he made a vow specifically tied to praying there.
The second opinion on the fundamental issue is that an obligatory prayer is valid inside the Ka'bah, just as a voluntary prayer is valid there (490). The hadith of Ibn Umar that the Messenger of Allah ﷺ prohibited praying in seven places, among which he mentioned “on top of the House of Allah,” (2) is weak and cannot serve as proof.
Moreover, the basic principle is that obligatory and voluntary prayers are alike in all rulings unless there is evidence to the contrary. Thus, whatever is established for a voluntary prayer is also established for an obligatory prayer, and whatever is negated for a voluntary prayer is likewise negated for an obligatory prayer, unless there is evidence to the contrary. Evidence for this principle is that, when the Companions mentioned that the Messenger of Allah ﷺ would pray on his riding mount wherever it turned with him, they said: “Except that he would not perform the obligatory prayer upon it.” (3)