With that said, I know many folks whom had knee surgery and were put on stationary bikes for rehab....
I ride with a jacked up knee on the residual side, so in essence I ride one legged. Does that count?
Ask your surgeon and physical therapist to be certain. But when my seventysomething mom had knee replacement surgery around 2007 they had her up out of bed almost immediately, and follow up therapy at home included lots of time on a machine that automatically flexed her knee joint for for half hour sessions a few times a day. Within a week or two of discharge she was being encouraged to use one of those floor pedaling doodads that can be used while sitting in an ordinary chair - I thought the thing was junk, but exercise bikes never feel like the real thing.
Same routine with her shoulder replacement surgery a few years ago - they had her up and moving almost immediately, with follow up physical therapy and evaluations. Fortunately she cooperated pretty well with physical therapy and healed as well as can be expected (she also has degenerative arthritis affecting every joint, so she was never going to be in great shape). At the other extreme my grandfather refused to cooperate with physical therapy. As a result his muscles and connective tissue deteriorated and his artificial knee joint was always popping out of joint. It was pretty grotesque looking, but he seemed to think it was amusing.
My 70-y/o friend had hip replacement surgery a year or so ago and was back to playing tennis (slowly and gingerly) in 6-8 weeks.
As long as therapy is appropriate for your condition, and you're spinning rather than straining, the biggest risk to bicycling might be falling and re-injuring the knee.