Z.-Q. Chen and S. Lou (Ann. Probab. 2019) constructed Brownian motion on a space with varying dimension, in which a 1-dimensional space and a 2-dimensional space are connected at one point, and derived sharp two-sided estimates for its transition density (heat kernel). In this paper, we obtain sharp two-sided heat kernel estimates on spaces with varying dimension, in which two spaces of general dimension are connected at one point. On these spaces, if the dimensions of the two constituent parts are different, the volume doubling property fails with respect to the measure induced by the associated Lebesgue measures. Thus the parabolic Harnack inequalities fail and the heat kernels do not enjoy Aronson type estimates. Our estimates show that the on-diagonal estimates are independent of the dimensions of the two parts of the space for small time, whereas they depend on their transience or recurrence for large time.