The (Euclidean) hull of a linear code is defined to be the intersection of the code and its Euclidean dual. It is clear that the hulls are self-orthogonal codes, which are an important type of linear codes due to their wide applications in communication and cryptography. Let C be an [n,k] cyclic code over Fq, where Fq is the finite field of order q. In this paper, we will employ the defining set of the code C to present a general characterization when its hull has dimension k−ℓ. Furthermore, we mainly focus on the primitive q-ary BCH codes C(q,n,δ,b) when b=0 and b=1 based on the general characterization. Especially for binary and ternary cases, we will present several sufficient and necessary conditions that the hulls of the codes C(q,n,δ,b) have dimensions k−2 and k−3 by giving lower and upper bounds on their designed distances, which extends the results of [17]. In addition, several classes of binary and ternary self-orthogonal codes are proposed via the hulls of BCH codes and their parameters are investigated in some special cases.