Spam, aka junk email, is a nuisance, and it can be very annoying and time-consuming to deal with/delete it every day when you start using your email system.
All email sent to the Microsoft Office 365 (O365) users is processed by the O365 Exchange Online Protection (EOP) system. The O365 EOP uses many advanced filtering techniques to filter or block spam/junk email based on the content, header, language of the message, URLs referenced in the message, attachments, and other criteria.
To further fine-tune the protection, you can customize the Junk email settings for your O365 account by using the O365 Block or Allow settings to help control unwanted and spam/junk email messages sent to you. This is done by creating and managing lists of email addresses and domains that you trust and those that you don't. You can add the email address of the legitimate senders/domains to your "Safe Senders" list so that email from them will always go to your Inbox. On the other hand, you can add the malicious senders to your "Blocked Senders" list so that email from them will always go to your Junk Folder.
You can setup such customization using either Microsoft Outlook or O365 OWA (Web logon). Please see the respective steps below:
Add Addresses to "Safe Senders" List in O365
Add Addresses to "Blocked Senders" List in O365