Any claim that your Mac is infected with a "virus" is a scam, so that's the quick answer to your question.
The Notifications you are encountering amount to an annoyance. If you were to click on them they would open a web page alleging your Mac is infected with something (hence the scam) and offer to "scan" your Mac (which is a lie) in an effort to get you to install something malicious, or to call a toll-free number that will connect you to a criminal whose job it is to convince you to give them your credit card number, bank account information, Apple ID, etc. That's the threat.
Stop the annoying Notifications by reviewing Customize website notifications in Safari on Mac - Apple Support. Apparently, you granted one or more websites the authority to harass you with annoying Notifications. When confronted with an offer to do that, your automatic, reflexive reply ought to be "just say no." Saying NO to scams is your first line of defense. NO stops the threat before it can even arise.
Excerpted from Effective defenses against malware and other threats - Apple Community:
Beware spontaneously appearing, unsolicited popups demanding immediate action. Think before you click.