Is giving condolences to a professor socially acceptable?
It's not merely perfectly fine (e.g., in the U.S.), but a very good thing to do. (Conceivably in other cultures it could be construed as too intrusive, we must acknowledge.)