M8 with a 4s shutter is better at low light than the Z2 with static subjects. But they must be in the foreground. M8 allows you to set shuter sped which no android camera can do. It also allows to set iso with video. A first for any phone camera. Its camera software is feature rich. Closest match to Nokia camera software interface on android.
when they say the camera is worse they are primarily referring to a parameter known as texture. if you take a photo of trees with leaves the details won't come out as well as cameras tuned for it. This is true and is not what the m8 should be used for. You like to shoot scenery or any content where background details are prominent then don't use an htc one. If you do it will be a compromise. Ok but not comparable to others.
Samsung, apple, LG are good lighting optimised cameras, they cheat with low light. They won't venture too far from this niche. Good with both foreground & back if the lighting is right.
lumias & Z's have more light flexibility, good light and low light. General purpose, jack of all is more applicable to these. But it takes practice to get the best out of both. The previous 3 will be easier to use and more consistent in good light.
m7/m8 are foreground shooters, very fast with good capture in indoor situations. They can freeze moving subjects indoors better than the Z's. Better here means better chance to get the shot.
Decide which niche you fall into. If you get it wrong it does not make the camera crap, you just got your choice wrong.