The topsoil itself is not poisonous to the dog but the topsoil that you buy or use can contain other chemicals such as fertilizers that the dog could get sick from.
So you should not let a dog eat topsoil if the topsoil is the kind that has fertilizer in it or any other topsoil that has unknown chemicals in it.
If the topsoil is homemade topsoil with natural ingredients then it will not harm the dog if eaten as long as you don't use fertilizer or other plant food in it.
Still it's best to keep your dog from ingesting topsoil as it could lead to a bowel blockage in the dog and cause other health issues.
A small amount of topsoil is unlikely to harm the dog but a larger amount of topsoil could harm the dog.