Law's ROOM ability is a very strong technique, and he can use it to slice whatever he wants. So why didn't he use it when fighting against Doflamingo, to slice him to pieces?
Law did use his Ope Ope no Mi. In chapter 729 you can see how Law has his room up and tries to slash Doflamingo, but unless he can actually get a hit in, the room isn't going to do him much good.
The second time (chapter 724) that Law used his ability on Doflamingo, he could have tried to get a sneak attack in, but that would have been isnane. If he would have slashed at this point it would probably have been suicide. He would potentially hit Sanji since he couldn't move anymore, he could end up falling in the ocean and Doflamingo would still have been able to attack Sanji with his whip, because the slash wouldn't have stopped him from doing so.
So Law basically didn't have a good opportunity to set up his room and have time to get a clean slash in with his sword. Also don't forget that Law's slash would only slice the body, but not actually damage it and since Doflamingo uses strings, he could just get his body part back to re-attach it.
In the manga, particularly Chapter 729, Law doesn't use his sword other than to defend against one of Doflamingo's string attacks. It's a quick skirmish.
In the anime, they're using what I call Filler Padding where you expand on canon scenes with non-manga content to elaborate the details. An example of this from episode 656 at about 7m30s shows Law using room & slicing where parts of the gate split easily enough but it was countered by Doflamingo's strings.
He did in both manga chapter 724 and anime episode 656 on the bridge just briefly.
Presumably, according to a filler padded scene of combat, Doflamingo can defend against it. Also it reinforces why Vergo thought Law couldn't cut him in Punk Hazard by believing Law to be too weak to slice through his haki-coated bod. The point is, some people can resist Law's slice to keep him from being overpowered.