I've heard that cooking honey or baking with it makes food or baked products toxic.If it is true,then how can we use honey while baking cookies or cakes that does not affect the quality of these?
Baking with honey is not toxic (as far as I know).
However, burning honey to the point of carbonization might be - it will release nasty black fumes.
That said, the same would happen with any other sugar, or mostly any food if you burn it to the point it's black. So it's as harmful (or harmless) as any ingredient.