However, if the cough is severe and very forceful, there's a slight risk of pulling or loosening stitches that have been used during the surgery, which may or may not be a problem.
Also, if you are coughing
up colored phlegm
(yellow, brown, green, etc) then you most definitely need to be seen by your doctor - it could mean an infection.
I've also had a hysterectomy several years ago and I know how painful it can be to cough after an abdominal surgery.