As someone who's worked in kitchens...this happens all the time. Technically, it's not considered sanitary.
Shame on that cook for doing it when watched as I imagine they could be cited by the health dept.
Theoretically, as long as whatever he or she was cooking was at a high enough temp to kill any bacteria, it doesn't really matter (except that it looks bad and is breaking health code), but if it was a simmering sauce on very low temp, for example, it could be a problem for someone, say, with a compromised immune system (I imagine most people don't get sick from such a common practice because healthy people can rid themselves of small amounts of most bacteria and viruses with no problems).
Remember the first Top Chef episode from last season with the obnoxious Irish guy getting booted mainly for tasting with his finger?