There is no problem in attending Sunni congregational prayers; it is permissible and there are some reports according to which one who stands in the first row of their congregational prayers is like one who has offered his prayers standing behind the Holy Prophet (S) in the first row.
In any case, if possible, one should offer his prayers according to Shia way and if there is no need for Taqiyah (dissimulation) and one offers his prayers in Sunni way, he must repeat his prayers. Of course, there are some scholars who are of the view that if the conditions for practicing Taqiyah are not met, one must repeat his prayers under all circumstances.
Question: Salamun alaykim, I am living in Istanbul. Close to my house and workplace there is a mosque which belongs to Sunni community. I stand behind a Sunni prayer leader offering congregational prayers with Sunnis without using turbah but I do not fold my hands during prayer. Is it permissible? Is it necessary for me to offer the prayers again?
Some grand religious authorities have also replied to the same question. Their answers are as follows:
Grand Ayatollah Khamenei:
In the said case, if using turbah is not in opposition with practicing Taqiyah, it is necessary to do Sajda on something which is allowed for prostration.
Grand Ayatollah Makarem Shirazi:
If you are associating with them, there is no problem in offering prayers with them to protect yourself provided that they do not express enmity against Shia. However, doing Sajda on carpet is not allowed except where one practices Taqiyah in Sunni mosques.
Grand Ayatollah Noori Hamedani:
If possible, one should do Sajda on things which are allowable for Sajdah but there is no problem in offering prayers behind a Sunni prayer leader and one is not, in the said case, required to repeat his prayers.
Grand Ayatollah Saafi Gulpaigani (may Allah grant him long life):
If you are not in the state of Taqiyah, it is not sufficient and it would be necessary to repeat the prayers.
Grand Ayatollah Sayyid Ali Sistani:
Question: Can one say one’s congregational prayer behind a Sunni Imam with the intention of Jama’at (congregation)? And should one recite al-hamd on his own?
Answer: It is permissible to offer prayer in their congregational prayer. However, it is obligatory upon you to recite al-Hamd and Sura-e Tawhid yourself – be the recitation in low voice though.
Question: I am 19 years old and a convert to Islam of five months. My question is, being a practitioner of Twelver Jaf’ari Islam is it permissible for me to pray behind a Sunni Imam for Salaatul-Jumu’ah and for regular congregational prayers, and is it required to prostrate on Turbah inside a mosque?
Answer: Taking part in Friday and congregational prayers of the Ahl-e Sunnat is permissible in areas where Taqiyah (dissimulation) is required. If you are not going to face a problem, you should, as far as possible, prostrate on something upon which Sajda (prostration) is permissible. Prostration on carpets in the case of Taqiyah or out of necessity is permissible and there would be no objection in it. But if you are not offering your prayers with them out of Taqiyah it is not necessary to attend their congregational prayers and you can offer your prayers separately. In any case, Friday prayers performed with them is not sufficient for Zuhr prayers. Therefore, it is necessary to perform Zuhr prayers separately.
 Kulayni, Muhammad bin Ya’qub, Al-Kafi, vol.3, p. 380, Dar al-Kutub al-Islamiyah, Tehran, fourth, 1407 A.H. The Arabic version of the tradition is as this:
(عَنْ أَبِي عَبْدِ اللَّهِ ع قَالَ: مَنْ صَلَّى مَعَهُمْ فِي الصَّفِ الْأَوَّلِ كَانَ كَمَنْ صَلَّى خَلْفَ رَسُولِ اللَّهِ صلی الله علیه وآله و سلم)
 Ayatollah Saafi Gulpaigani.
source:islamquest.net & sistani.org