Workouts on the trainer are more predicable than those on the road. You do not have to deal with the elements, traffic or animals. When using a trainer, you can be more consistent and focused on your workout. You can set the resistance and complete a workout using your heart rate target zones in an easier manner on the trainer as compared to riding outside.
However, most basic trainers do not allow you to adjust the resistance on the fly to simulate hill climbing, riding downhill and riding with good form.
Overall, when you have limited ability to ride outside due to weather conditions, a trainer workout can be a good replacement for outside workouts.