Yes, "to" is the correct word here. You are "generalizing the theorem to the larger set".
In English we talk about "direct objects" of a verb and "indirect objects". In general the direct object is the thing actually acted on, and the indirect object is a destination of some sort. The exact meaning of a direct versus an indirect object depends on the verb. We normally put the direct object immediately after the verb, and any indirect objection preceded by the word "to".
The common type of example I always see is, "I gave the book to Bob". The direct object is "book"; the indirect object is "Bob". The book is the thing given; Bob is the destination of that giving.
Slightly different: "I explained the problem to Carl." The thing I explained is the problem. The person receiving the explanation is Carl.
In your case, "This theorem generalizes Theorem 1 to real numbers", the direct object is Theorem 1. It is the thing being generalizes. The indirect object is real numbers. They are the target or destination of the generalization.