Personally I wouldn't.
With wood ash, what you're getting is all the stuff that didn't burn off, which hence contains minerals that your veg need, and helps to raise the pH of the soil.
With chimney sweepings, that's stuff that was carried up in the smoke, but then condensed or collected on the walls of the chimney. As a result, especially with offcuts from any treated wood, I think this could contain lots of nasties that you don't want near your food. Your mileage may vary of course - this is just my gut feel.