Is it safe to plug my iPhone into a life fitness cardio machine?
Your iPhone should ask whether you want to Trust This Computer if the host being connected to wants to access your data.

You should be relatively safe by tapping Don’t Trust, barring any unknown USB exploits in iOS. This is always the big caveat when it comes to security.

Otherwise the platform doesn’t install anything without your consent. If the cardio machine tries to do that, you will get a popup, which you can always decline.

This shouldn’t keep you from streaming movies onto the screen.