Um, what gave you the idea that the opposite can be true? CALs are needed when you are accessing a service, in the case of DirSync the user does nothing like this. And to access any O365 related service, they need the corresponding O365 license, not CALs.
Maybe I didn't express myself correctly, but I'm referring to the synchronization of local users (which use Windows Server on their on-premises datacenter) to O365, which is in the cloud. Since Windows Server is involved, Windows Server CALs could be a requirement.
Azure AD Connect does not inherently require any licensing; it is a free tool from Microsoft that synchronizes objects. As Vasil pointed out though, to use the Office 365 services, users will need subscription licenses. For your local AD objects/environment/server, you of course need to license that properly, which would involve CALs. I'd recommend speaking with your Microsoft Rep or a Licensing Vendor if you're unsure of your CAL requirements on premises.
*As an exception, users do not need Windows Server CALs when accessing the server software solely to sync between an Active Directory infrastructure running on Customer’s Licensed Servers and Azure Active Directory
Microsoft Volume Licensing Product Terms (Worldwide English, July 2018) p. 46
In the Windows Server section under "3.1 Server Software Access"