The idea that all war happens outside of international law and is always breaking the Geneva conventions is false.
It's something war criminals and their appeasers pretend, to excuse their own actions. Kind of like those rapists who say all of us would rape people if we could get away with it. No, no we wouldn't.
At least, some of those in the attacker's army care about the legality from time to time, for fear of finding themselves on the wrong end of a war crime tribunal at some point.