Nano-size confinement induces many intriguing non-Fourier heat conduction phenomena, such as nonlinear temperature gradients, temperature jumps near the contacts, and size-dependent thermal conductivity. Over the past decades, these effects have been studied and interpreted by nonequilibrium molecular dynamics (NEMD) and phonon Boltzmann transport equation (BTE) simulations separately, but no theory that unifies these two methods has ever been established. In this work, we unify these methods using a quantitative mode-level comparison and demonstrate that they are equivalent for various thermostats. We show that different thermostats result in different non-Fourier thermal transport characteristics due to the different mode-level phonon excitations inside the thermostats, which explains the different size-dependent thermal conductivities calculated using different reservoirs, even though they give the same bulk thermal conductivity. Specifically, the Langevin thermostat behaves like a thermalizing boundary in phonon BTE and provides mode-level thermal-equilibrium phonon outlets, while the Nose-Hoover chain thermostat and velocity rescaling method behave like biased reservoirs, which provide a spatially uniform heat generation and mode-level nonequilibrium phonon outlets. These findings explain why different experimental measurement methods can yield different size-dependent thermal conductivity. They also indicate that the thermal conductivity of materials can be tuned for various applications by specifically designing thermostats. The unification of NEMD and phonon BTE will largely facilitate the study of thermal transport in complex systems in the future by, e.g., replacing computationally unaffordable first-principles NEMD simulations with computationally less expensive spectral BTE simulations.