Personally, this is... about 90% of the protagonists I write. A protagonist is simply the character the story focuses on, and the antagonist is the character who stands in opposition to his/her goals. For a classic example of the protagonist-as-bad-guy, antagonist-as-good-guy, check out the manga Death Note, if you're into that kind of thing, or the anime or movies if you'd prefer. Yagami Light is an absolutely monstrous person who essentially goes on a supernatural killing spree to "rid the world of all evil" and declare himself a god of the new, purified Earth. He's unambiguously a bad person, albeit one with sympathetic motives. And yet the story is told almost completely through his eyes. L, on the other hand, stands in direct opposition to Light and is trying throughout the story to bring him down, and the plot is essentially a mental competition between the two, and, even though his motives are partially selfish, it's completely clear that when/if he defeats Light, good will have won.
IMO, the story is significantly enhanced by this. Light isn't the protagonist because he's doing something good; he's the protagonist because he's driving most of the action. If the story were told from L's POV, it would be completely different. It wouldn't be asking the same questions about good and evil. You wouldn't see why Light does what he does. The story's suspense wouldn't lie in what would happen next; it would lie in figuring out what was actually going on.
Of course, this ranges in extremity. You'll find anti-heroes who are anti-heroes because they don't drive the plot and are instead just along for the ride, such as Arthur Dent from Hitchiker's Guide. You'll find others who are really quite heroic, but maybe don't act/look entirely the part, like Disney's Aladdin. Others are good people forced by circumstances to act in a decidedly un-heroic manner, like Mal from Firefly. Some will be people with genuinely sympathetic motivations who take methods to such extremes to the point that they are only heroes because of their motivations, like Arya Stark in ASOIAF. And others will be the very extreme anti-heroes, to the point that they're really just villains in the slots of protagonists, like Humbert Humbert from Lolita.
Long story short, while bad guy protagonists are rare, and get even more uncommon the darker you get, it can be a brilliant way to tell a story if you do it right.