There are definitely some instances where breaking the law is justified. For example, getting someone or something out of danger, like a kid or an animal, is worth breaking and entering. For the ends to justify the means, the result has to be something that is legitimately helpful and morally right to outweigh the law breaking.
I think it truly does depend on what it is and if it justifies the means. If you have to steal medicine to help your dying child, then I think the stealing might be okay. If you are stealing from people just to make your life better and have more money, then it's not okay.
I'm not a big fan of clichéd sayings, especially ones like this, because they are too broad and way too abstract. When it comes to a specific end, sometimes the means can be justified when breaking the law, sometimes they can't. But there are usually more legal ways to go about things.
No, the ends do not truly justify the means, even when it means breaking the law, because people who use that phrase only know that they are about to hurt or be unfair to someone else in order to get what they want. People justify all manners of illness and lawlessness by saying that it's for the greater good.