If a man dies at his house but his body is managed at the mosque, is it permissible for his wife to also go to the mosque and give her last respects for her husband?
The term iddah means a restriction for a woman against beautifying or adorning herself for a certain period of time in a certain specific situation. It also includes the restriction of her from spending the night away from her own house. 
From Ummu Habibah radhiyallahu ‘anha, Rasullullah PBUH said:
لاَ يَحِلُّ لاِمْرَأَةٍ تُؤْمِنُ بِاللَّهِ وَالْيَوْمِ الآخِرِ تُحِدُّ عَلَى مَيِّتٍ فَوْقَ ثَلاَثٍ إِلاَّ عَلَى زَوْجٍ أَرْبَعَةَ أَشْهُرٍ وَعَشْرًا
“It is not lawful for a woman who believes in God and the last day to observe mourning for one who has died more than three nights, except for the four months and ten days in the case of a husband.” 
If the woman is pregnant when her husband dies, then her ‘iddah ends with the birth of her child, regardless of whether it takes a long or a short time. If the wife isn’t pregnant or is pregnant but not the child of her husband, for instance, the wife is pregnant but the husband has yet to reach puberty or her husband has been missing for more than four years regardless of whether he has had intercourse with her or not, then her ‘iddah will end after four months ten days. 
A woman who is in ‘iddah due to the death of her husband, it is obligatory for her to do the following:
- Mourn the death of her husband by not beautifying or adorning herself such as wearing make-up, perfume, brightly coloured clothing, jewellery and others.
- It is obligatory for her to stay at her house throughout the ‘iddah period. She is also prohibited from going out except if there is a need or necessity. For example, to buy her food necessities, work if she isn’t allowed to work from home (WFH) continuously throughout her ‘iddah period. She is allowed to go outside of her house to talk to her neighbours to avoid getting lonely, sad or depressed. 
Imam Ramli in his book stated the permissibility is subject to the condition that the woman in ‘iddah can only go out during the day and return home to spend the night at the house she is completing her ‘iddah at.
Thus, it is impermissible for a wife in her ‘iddah to follow the funeral procession or her husband’s body to the mosque to pay her last respects to him. As a pious woman, she should always obey the religion of Islam and the shariah even when her husband has just died. The attitude she adopts, will bring about a lot of goodness in her life afterwards. She can visit her husband’s grave after her ‘iddah has ended following the conditions and manners of visiting graves. Wallahu ‘alam.