両方とも正しいです。(Both are correct.)
うち に かえります。
うち へ かえります。
へ and に are mostly changeable as a direction particle.
But, there are some cases when we don't use へ.
#1 when objects are close to each other.
アルバム(〇に ?へ)写真(しゃしん)をはる。(アルバム and 写真 are close)
壁(〇に ?へ)絵をかける。(壁 and 絵 are close)
#2 some idiomatic phrases
お風呂(〇に ?へ)入る。
電車(〇に ?へ)乗る。
The followings might be useful if you'd like to go deeper:
に is used for destinations or small range.
へ is used for directions or wide range.
The following sentences both mean that I go to a park,
but #4 put more weight on the direction than the goal itself.
#3 公園に行く。
#4 公園へ行く。
However, please let you remind that these differences are so subtle that people don't think about much sometimes.