As always let's mention health and general fitness first. And of course, you can improve your health from cycling and/or using a Peloton. Cycling can be a great low impact option for exercise. There can be lots of pro's and cons of group exercise training and even cycling, but this post will be short and not include them all.
Cycling can be great cardio-respiratory exercise. Similar rules apply as to strength training, progressive overload is needed to improve fitness. And using RPE or Heart Rate training zones can help direct your training.
If you are very reconditioned or unfit, then cycling could help golf performance, but otherwise, it's unlikely to directly improve it. Maybe a little more energy on the course and thats about it.
If you really enjoy cycling or the Peloton, then this is another reason to keep doing it. If you train to improve your golf performance, and the Peloton is all you are doing, you will not see the improvements you could get from something like strength training.
Sure, you can do various Peloton workouts, however, these are mostly high reps, cardio based workouts. So, again, if you are a complete newbie to training, then you could see improvements in fitness and strength, which could transfer into better golf performance. But otherwise, you will need more load to improve maximal strength and/or to move explosively to improve speed and power.