There's a lot of nuance to the way Tolstoy treats ambition in War and Peace. We have several examples of people who use their inner resources to climb ever higher, but there is no one lesson to be drawn from their examples. Boris, although seemingly morally bankrupt and filled with naked greed, succeeds in his aims and continues rising through the social ranks. The Kuragins, who pursue social advancement through their sexual appeal, come to ignoble ends. Finally, Dolokhov, who uses his machismo to make his way in the army, starts out as a semi-psychopath and ends as a semi-hero.
Ambition in War and Peace is almost infectious; those who are around ambitious people cannot help but try on that personality trait themselves, sometimes with disastrous results.
Tolstoy purposely makes some of his characters into analogs for the real-life people he describes. So for example, Helene is a good match for Napoleon, as both are led by their ambitions to bite off more than they can chew. Andrei is based on the Alexander model, full of the desire for glory and motivated by liberalizing political ideas, only to give up any and all ambition altogether a short time later.