Indoors, it's not common practice and I don't recommend it.
In nature, earthworms provide castings and aeration.
Indoors, perlite provides aeration and you can buy worm shit or worm shit extract pretty cheaply.
It's far more efficient and anyway I highly doubt the worms would survive in such an artificial environment with no food for long.