Yes, Macs are vulnerable to viruses and malware just like Windows.
However, the platform isn’t as attractive a target as Windows, due to there being so many more Windows machines to target. However, Mac users are still vulnerable to malware, phishing attempts and other online perils.