It is unkown what the true origins of the Giant Jack-O-Lantern, but It may be in fact that Marnie Piper could have been the true creator of the Jack-O-Lantern. Due to the fact in Return to Halloweentown she created one that she gave to Aggie when she was about to leave Cromwell Castle. This can be explained by the the Novikov Self-Consistency Principle. This theory of time-travel, stating that "Nothing can be changed because anything a traveler does merely produces the circumstances they had noted before traveling," This similar theme can be found in the Harry Potter series via Time Turners. Though this can also cause some inconstistencies with the rests of the films.
The Jack-O-Lantern may also be the source of magic for Halloweentown, as whatever happens to it seems to affect Halloweentown. In the first film, Marnie Piper placed Merlin's Talisman in it to rid all evil within Halloweentown. In Halloweentown II, Kal Placed the Grey Spell on the Jack-O-Lantern and it turned into a plain grey cube. This may have caused the rest of Halloweentown to become grey. Kal might have just also placed the spell on all of Halloweentown but it is mostly implied that the former is more accurate as in the same movie, Aggie states "As goes the Jack-O-Lantern, so does Halloweentown" Which implies that it is the source of power for Halloweentown.