Yes. Steam's SteamPlay feature makes cross-platform play between PC and Mac possible, and any title carrying the label below is safe to buy on either system.
Look for this on the store page:
SteamPlay(tm) PC+MAC
That marking means one purchase covers both versions and, crucially, that the multiplayer pools are shared — a Mac player and a PC player land in the same match.
The cross-pollination went further than two platforms with Portal 2, which also let console players join in. Not every game supports it, so the label is the thing to check before you buy for a mixed household.