Also adding a flag is_deleted (ie,boolean variable which will mark tempates as deleted) in the config file of those temporarily deleted templates will cause any issue?
I don't know how would you plan to do this exactly... I think it won't work in some simple way. However I don't know fully your scenario.
Also what do you mean by handling at the database level did you mean store like mongodb (where templates are stored)
Yes
do you have any example for custom extension?
As noted in the docs, everything is implemented as extensions in jsreport. Here are the sources
https://github.com/jsreport/jsreport/tree/master/packages