It would be safe to visit the vet just to make sure everything looks alright.
As someone else has already suggested, some dogs will whine and cry as a reaction to anesthesia. It is pretty common.
If he is crying 24 hours after the surgery, then something else may be bothering him :/