The Imam issued a special command to him to perform the wudhu the Sunni way, because the Imam knew they would spy on him and find out. Hence, he was not excused in disobeying the Imam.
As for us, if we don’t practice Taqiyyah we get harmed (attacked, killed, etc…) then we are obligated to do Taqiyyah. If one prays in a dangerous area knowing that he could be killed for the Shia way, then praying the Shia way would be invalid and haram. But if it’s not to this extent, like living in a safe society (like in Sweden) then you don’t have to do Taqiyya. Yes, it’s optional. You can go to their mosques and pray their way to establish good ties and bring harmony to society (according to many scholars). But you are not obligated to do that.
As for the Hajj, if you observed it properly, and you observed the pillars of the Hajj, then it doesn’t have to be repeated if you did something out of Taqiyyah.