Both are correct. دخل إلى البيت is also correct. According to several dictionaries it should be دخل في البيت but omitting the preposition and treating the following noun as an object is acceptable. In the case of إلى, you are using it with the meaning of في, which is also acceptable. All three have the exact same meaning in this context.
إلى can only be used if you are entering a place, في can be used if you are entering a place or something else (a religion, a race, a programme/course, the army, a conversation…etc.) and you can omit them without compromising the meaning.
الباء and على can’t be omitted without compromising the meaning.