Government employees are generally not allowed to take up private employment or business without prior permission.
The conduct rules for central and state employees treat unauthorised outside work as misconduct.
You can apply for permission for specific activities like writing or teaching, but approval is not guaranteed.
Freelancing income without permission can lead to disciplinary action.
If in doubt, route a written request through the proper channel before starting any outside work.