We study the flow of energy between a harmonic oscillator (HO) and an external environment consisting of N two-degrees-of-freedom nonlinear oscillators, ranging from integrable to chaotic according to a control parameter. The coupling between the HO and the environment is bilinear in the coordinates and scales with system size as 1/√N. We study the conditions for energy dissipation and thermalization as a function of N and of the dynamical regime of the nonlinear oscillators. The study is classical and based on a single realization of the dynamics, as opposed to ensemble averages over many realizations. We find that dissipation occurs in the chaotic regime for fairly small values of N, leading to the thermalization of the HO and the environment in a Boltzmann distribution of energies for a well-defined temperature. We develop a simple analytical treatment, based on the linear response theory, that justifies the coupling scaling and reproduces the numerical simulations when the environment is in the chaotic regime.