Gravity is doing that work!
If you observe, the domino is in a position of unstable equilibrium.
Edit: as pointed out in the comments, this position is of a metastable and not unstable equilibrium.
This means that the domino is in a state where it hasn't achieved the minimum possible energy state yet. The energy I'm talking about here is the gravitational potential energy.
Gravitational potential energy is directly proportional to the height of the center of mass from some reference point.
That means that when the domino is standing up it has more energy than when it is laying flat. So when you flick the domino, it tends to fall down. It is just trying to achieve a state of lower potential energy.
Now when you have a lot of dominoes standing up in a row, the whole system of dominoes can be regarded to be in a position of
unstable equilibrium(metastable equilibrium), i.e. their combined center of mass is at a greater height than when every one of the dominoes has fallen. So all you need to do is flick one domino and they will all come tumbling down.
You can also think of it this way.
The people who arranged those dominoes initially had to do work against gravity in arranging each domino in the upright position.
So they had to provide the whole system of dominoes with energy initially, which was then all dissipated due to work done by gravity after the flick.
So energy is still being conserved!