Some website ads do cause a web page to open warning that you have a virus and to phone a number when you don't. Never call those numbers.
As previously mentioned, an ad-blocker will remove the likelihood of getting a virus as well as any fake warnings.
Windows Defender does a good job but if you have questions about it, there is an 'offline' scan option in the control panel which is worth running if you have any concerns.