Sure, you should be able to use the AttachmentExtensionMatchesWords condition, as detailed for example here: https://learn.microsoft.com/en-us/exchange/security-and-compliance/mail-flow-rules/inspect-message-attachments#inspect-the-file-properties-of-attachments
Though the common attachment filter under Malware policies is probably a better place to enforce this.