It's not really a fact though. Sure there are leaders who make shithead decisions that break the rules even when they aren't on the brink of defeat, like Phosphorus against civilians by Israel or torture in Guantanamo, but those were choice and not necessity.
It's more like they chose to add war crimes to their strategy even when they didn't have to.
Assad may be another argument; he might have felt he needed to use gas strategically. That was after the Libya intervention though and perhaps he thought the West would intervene and that he would have to liquidate his opposition as fast as possible. It turns out it was unnecessary due to support from abroad and was actually the cause of the closest call for Western military intervention against him.
In that instance it had the potential to hurt his cause much more than it helped it by most accounts.
All of those instances have created much more trouble than they are worth. While you are correct in saying war crimes were committed in recent times, I would argue they were not strategically valuable in that they were not necessary and in addition were in fact a detriment.
In either case though I would still venture to say, no, it's not okay to commit war crimes even when strategically valuable, especially if it is a matter of strategic convenience rather than the survival of millions so to speak. The lone exception I would say is perhaps a 'saving the world' example, where you nuke Racoon City. Unfortunately this brings my thoughts to the use of the atomic bombs upon Japan. As I have neither a time machine nor a dimensional transfer device I am forced to withold judgement of the choice to use that weapon; perhaps those people were nuked needlessly and a peace could have been reached or perhaps it saved a million people who would have died in the invasion of Japan and the subsequent first use and possible exchange of atomic weaponry against fellow humanity later in time than historically.