Hi there-
If you exercise routinely as part of your healthy lifestyle, then I say continue you routine until a few days before the procedure, at your usual pace and intensity. I would not want you working out extra hard because you are having surgery.
Similarly, if you are not a person who normally exercises regularly, I do not think it benefits you to start an exercise program in the weeks leading up to your surgery if you are doing so because you think it will improve your outcome or recovery- it probably will not.
On the other hand, if your surgery is months away, and you would like to achieve a better state of health, and you are beginning an exercise program as part of a healthier lifestyle that you think you will be able to maintain over the long term after your recovery period, then doing so is a smart thing.
I hope that helps you!