Yes, yes, a thousand times yes!
You can give a hero all the bad habits, wrong motives, personality quirks, and immaturity in the world, and yet if he comes to the point of sacrifice and does what must be done for his cause, he has earned the right to be called "hero."
In fact, characters like that are the more intriguing for their flaws. And if you want to create a really interesting hero, introduce a character arc; make him change over the course of the story. If the particular mode of change actually becomes what enables his act of sacrifice, so much the better. =]
It really works in the musical. I remember when I saw it and he begins the small verse that would reveal his past crimes... I remember saying to myself, "you don't have to tell." And if he wanted only his happiness, he did not. But he wanted Cosette's happiness more, so he had to.
Sydney Carton has the same sacrifice. Because he is Charles Darnay's exact duplicate, he will exchange himself for Darnay and go to the guillotine in Darnay's place so Lucie Manette can be happy.
Samwise Gamgee's sacrifices abound throughout LOTR. In fact, he is far more interesting to read than Frodo, Aragorn, and Gandalf.