In this paper, we explore a two-way connection between quasimodular forms of depth $1$ and a class of second-order modular differential equations with regular singularities on the upper half-plane and the cusps. Here we consider the cases $Gamma=Gamma_0^+(N)$ generated by $Gamma_0(N)$ and the Atkin-Lehner involutions for $N=1,2,3$ ($Gamma_0^+(1)=mathrm{SL}(2,mathbb Z)$). Firstly, we note that a quasimodular form of depth $1$, after divided by some modular form with the same weight, is a solution of a modular differential equation. Our main results are the converse of the above statement for the groups $Gamma_0^+(N)$, $N=1,2,3$.