Too nebulous to answer, for me. I’ve had four surgeries on one of my knees and cycling is a big part of my fitness lifestyle. However, it depends on the injury, the treatment, the outcome and the prognosis. I would first speak with your orthopedist and physical therapist to determine if cycling is appropriate in your individual situation.
Good luck. Hope you can keep on riding!