Drain cleaner is safe to put into a toilet but it may not clear the clog out since the clog may be further down in the drain where the drain cleaner will not reach.
Try plunging the toilet first and using an auger and make sure that you're getting suction with the toilet plunger to force the air backwards and out into the drain line.
You can also use baking soda and vinegar mixed together into the toilet which will dissolve some toilet and drain clogs naturally.