There are a couple of ahadith showing that the Prophet () and his sahaba () joined the dhor and 'asr prayers (by praying them one after one at the time of the later one) and Maghrib and 'isha' prayers in cases of rain or fear and it's also said just to create an ease for the ummah.
See for example in:
- Sahih Muslim 1, 2, 3, 4 and 5.
- Sunan abi Dawod 1, 2, 3 and 4.
- Sunan an-Nasa-i 1 and 2.
- Jami' at-Trimidhi
- Sunan ibn Majah.
I'd like to know whether one could conclude from these ahadith that this ruling of joining prayers can only be applied in mosques or whether it is possible to do it likewise for any jama'a and what is the justification for any opinion.