maghrib

Tahiyyatul musjid

Q: When praying our fard salat in the musjid, I was told that we can have the intention of tahiyyatul musjid included in the fard salaah or the sunnahs prayed before the fard. Does this apply also to maghrib salat (i.e. can we combine the fard of maghrib with tahiyyatul masjid), or is it different since that is a three rakaat salah? If it doesn't apply for maghrib, are there any other salaahs for which it doesn't apply too?