Coffee grounds are a good nitrogen source and can be good for the soil if not over done. If too much is put down it can get crusty and prevent air and water from getting to the soil. In that case, break it up and turn it under, into the soil.
Ashes tend to raise the pH of soil, make it more alkaline. This is not necessarily a good thing unless your soil is quite acidic to start with. Tomatoes like their soil a little bit acidic. And cigarette ashes (as opposed to say wood ash) sound bad. Tobacco carries tobacco mosaic virus to which tomatoes are quite susceptible. Hopefully burning the tobacco kills the virus, but viruses are pretty tough; I don't know that for sure. Especially if any little bits of unburned tobacco could get mixed in there.