It has long been customary in Christian culture to invoke the holy as an exclamation of surprise or awe. For example, the French often use “Sacre bleu!” which means “Sacred blue!” and is an invocation of the Blessed Mother, who is usually depicted in art wearing blue. In older English-speaking societies, people would say “By the saints!” or “God’s bones!” Even today, English speakers will say “By God!” or “Oh my God!” “Holy smokes!” and “Holy cow!” are more modern forms of such exclamations.
While not intrinsically sacrilegious or blasphemous – particularly when used without deliberate intent – such expressions ordinarily should be avoided, especially by children. You might tell the child who asked you the question that such expressions are not “bad” but they demonstrate thoughtlessness and that we should try hard to make sure that we think before we speak and choose our words more carefully.