Depends on the type of knee pain. Some can be relieved with those elastic doodads from Mueller and other makers. I used a
Mueller jumper's knee strap for a couple of weeks in June when I resumed riding a road bike. The ergonomics were just enough different from my hybrids that I had some minor knee pain while getting the bike dialed in to suit myself.
Just needed a little help with the strap while gradually strengthening the knee to the slightly different riding position. No problems since July even though I'm tackling more hills and sprints with interval training.
During a group ride a few weeks ago I met a fellow who rode with full knee supports on both legs, those hinged metal and elastic padded doodads. His legs looked pretty frail. But he kept chugging away on the 16 mile group ride at about a 12 mph pace, including some gravel and modest hills.