Al salam alaykum. I'm reading about the sunnah rakaat before fard prayers (i.e. 2+2 before and after dhur). Does tahiyyet al masjid count as part of the 2 before prayer?
No it doesn't count as such as it is highly recommended to perform these sunnah prayers at home where one doesn't need to pray tahiyyat al-Masjid. And as tahiyyat al-Masjid has no fix timing so it is a totally separate prayer.
This means if you entered a mosque and prayed your two rak'as tahiyyat al-Masjid and have time you should perform the sunnah before dhohr prayer and wait until the dhohr prayer starts afterwards you may pray the sunnah after dhohr. But it is better to pray these sunnah prayer at home if possible.