According to the official rules of the International Stratego Federation, it is impossible to capture all 40 pieces of your opponent:
12 The end of the match
12.1 A game ends when:
one of the flags is captured.
at least one of the players has no movable piece anymore. A movable piece is a piece that still has at least one legal move.