iOS - Photos & message access to MDM installed apps
MDM controls how an iOS device is remotely configured and what apps are pushed to be installed. It has nothing to do with what permissions are available to an app.

Reading photos stored on devices requires access to user photos. The mechanism to ask user for photos permission can be programmed by an iOS app developer and would work in the same way irrespective of the way the app is installed (MDM or App Store).

There are no permissions/mechanisms available in iOS which can let a third party app read text and WhatsApp messages. Each app is technically sandboxed and need to seek permission from iOS to access user data and device hardware.