Absolutely. Aerobic exercise is a good way to lose weight, and cycling is a good aerobic exercise. As for whether you can thicken your legs, it depends entirely on the load intensity of each ride, in short, the speed of your ride. Theoretically, the faster the speed, the greater the strength and the faster the muscles grow. But as far as the actual situation is concerned, it is absolutely impossible for you to reach this threshold, so you don't have to worry that cycling will thicken your legs.
At the same time, swimming, long-distance running and running are all good aerobic exercises. If Tai Chi routines, badminton and tennis are supplemented, the weight loss effect will be better.