  Hyperovals in $\PG(2,\gf(q))$ with even $q$ are maximal arcs and an
interesting research topic in finite geometries and combinatorics. Hyperovals
in $\PG(2,\gf(q))$ are equivalent to $[q+2,3,q]$ MDS codes over $\gf(q)$,
called hyperoval codes, in the sense that one can be constructed from the
other. Ovals in $\PG(2,\gf(q))$ for odd $q$ are equivalent to $[q+1,3,q-1]$ MDS
codes over $\gf(q)$, which are called oval codes. In this paper, we investigate
the binary subfield codes of two families of hyperoval codes and the $p$-ary
subfield codes of the conic codes. The weight distributions of these subfield
codes and the parameters of their duals are determined. As a byproduct, we
generalize one family of the binary subfield codes to the $p$-ary case and
obtain its weight distribution. The codes presented in this paper are optimal
or almost optimal in many cases. In addition, the parameters of these binary
codes and $p$-ary codes seem new.
