Masturbation is not harmful if it is not addictive. And it is a normal human activity when done now and then. If you have no pain in the wound site while mastrubating then it should not be a problem.
Next Steps
More importantly, continue the treatment suggested by your surgeon. I welcome further questions regarding your health.
Health Tips
Take care that you don't become addicted to masturbation.