It is a matter of definition, as given here. An ordinary differential equation of order $n$ is linear if the function $x(t)$ and its n-1 derivatives appear in the equation specifically to the power 1:
where the coefficients $a(t), b(t), ..., z(t)$ and the "driving force" $F(t)$ may be nonlinear functions in the independent variable $t$, but the overall left hand side of the ODE is a linear combination of the function $x$ and its derivatives.
This definition of linearity applies to both the undamped and damped harmonic oscillator models (and both their homogenous and driven varieties), which can be expressed as:
$kx(t)+mx''(t)=0$ (undamped and undriven)
$kx(t)+mx''(t)=F(t)$ (undamped and driven)
$kx(t)+dx'(t)+mx''(t)=0$ (damped and undriven)
$kx(t)+dx'(t)+mx''(t)=F(t)$ (damped and driven)
Therefore, a linear oscillator requires
- Hooke's law (or some other expression where the restoring force is linear in $x$ or its derivatives),
- A damping force which is linear in $x$ or its derivatives (most commonly $x'$, or it may simply be neglected) and
- Newton's Second Law of Motion, which guarantees the net force is also linear in $x$ or its derivatives (specifically $x''$).
This means if a nonlinear version of Hooke's Law was used, the resulting system (the ODE) would be nonlinear because there would be a nonlinear term in $x$. However, using the linear expression of Hooke's Law only guarantees linearity of the system if there is no damping present or if the damping is linear as well. If the system is a "simple" harmonic oscillator that will be the case (and there we be no driving force as well).
Note that a linear oscillator does not need to be simple, it may be damped and/or driven.