Ever since Catalina, developers have to "notarize" their apps via Apple notary service which checks the app for "malicious components". I'm talking about apps that are distributed outside of App Store.
If the app is not "notarized", you won't be able to open it by double-click the first time. There'll be an alert informing you that the software wasn't checked by Apple for malicious whatever. You'll have to open such app via the Open contextual menu (only first time, after that you can open such app normally).
Regardless, all Mac developers who actually care about their apps being open by the users, do notarize their software. So if you're able to open the app on your Mac then it's been already checked by Apple. (Otherwise you'll get the aforementioned alert.)
I don't know if Apple specifically checks for viruses during notarization, all they disclose about the process is "malicious content". Here's some developer docs regarding notarization (I couldn't find any consumer-oriented info):
Give users even more confidence in your macOS software by submitting it to Apple for notarization.
developer.apple.com