Can I set a macro to delete media from a particular Whatsapp group or contact?
It is not possible

Quoting MacroDroid developer, in future request (dated 21 Feb this year- you can access that from within the app in forum )


  WhatsApp has no SDK/API by design, they don't want third party apps interacting with their service.


When the automation app can't interact with WhatsApp, it obviously cannot set up automation tasks

I am not conversant with Tasker, but the limitation should be equally valid for any automation app