Yes, the service has a URL filter that checks for URLs within messages. If URLs associated with known spam or malicious content are detected, the message is marked as spam.
Customers with Microsoft Defender XDR for Office 365 licenses also get Safe Links protection. For more information, see Safe Links in Microsoft Defender for Office 365.