You can take pictures, but you should pay attention to the influence when taking pictures in public. It is particularly important that when you take pictures, you should not affect the right to use others, and the posture of taking pictures should also conform to the basic etiquette in public places.
Taking fitness photos in the gym is not impossible, but there are two preconditions, 1: Don't take up other people's fitness space. Taking pictures requires a good lens angle and spatial layout, but you need these, which is reasonable without affecting other people's normal fitness. In general public places, as long as the first two prerequisites are met, it is ok to take pictures.