Install Exchange Online Management Module
If you set SetPhotoEnabled to False in OWA Mailbox Policy. Microsoft teams will honor it.
if you have a hybrid server, make sure you run on Exchange On-Premises and Office 365 PowerShell (Connect-ExchangeOnline)
For changing this setting for a specific set of users you need to create a dedicated OWA Mailbox policy.
Get-OwaMailboxPolicy | FL identity,Setphotoenabled Set-OwaMailboxPolicy -Identity OwaMailboxPolicy-Default -SetPhotoEnabled $false
Now when you try to change the picture in Teams
Picture Options are disabled by policy.