I remember the main protagonist was a young boy who wore a red hat and he could travel between alternative dimensions.
Should be from maybe the early '90s, maybe '95 at the latest.
Science Fiction & Fantasy Stack Exchange is a question and answer site for science fiction and fantasy enthusiasts. It only takes a minute to sign up.Sign up to join this community
Could it be Mighty Max (1993)?
The series follows Max, an adventurous teenage boy who receives in the mail a small statue of a fowl, inscribed with Egyptian hieroglyphs whereof the translation states: "You have been chosen to be the cap-bearer. Go to the mini-mart and wait for a sign, Mighty Max". Shocked by the message, Max drops the statue, shattering it and revealing a red baseball cap emblazoned with a yellow "M", which he dons. The cap is capable of projecting wormhole-like "portals" through which Max can teleport across space and time.
Upon arriving at the mini-mart, Max is chased by a lava-monster sent by antagonist 'Skullmaster'. As Max flees, the cap teleports them to the Mongolian desert, where he befriends Virgil, a nearly omniscient Lemurian whose appearance is that of an anthropomorphic "fowl" (a running gag in the series is that Max refers to Virgil as a "chicken" to which the Lemurian replies "Fowl, actually"), who explains that Max's reception of the cap was prophesied c. 3000 B.C. Thereafter Max, Virgil, and Norman, his Viking bodyguard, travel together around the world, defending Earth against the minions of Skullmaster, who is responsible for the downfall of the Lemurians and the people of Atlantis. Norman is supposedly immortal and identified as or with Sir Lancelot, Thor, Samson, and Hercules. Most plot-driving episodes involve Skullmaster or one of his monstrous followers; but in many episodes, Max is required to stop an independent villain. While all episodes involve travel across Earth, one involves time travel, and the portal can even extend into the astral plane (as seen in the episode "Souls of Talon").
Mighty Max (1993–1995)
Max (Rob Paulsen), a twelve-year-old boy, finds a magical cap that can teleport him across dimensions.
The artwork depicts him as wearing a red baseball cap with a big yellow M at a very 90's angle.
Found by searching for: "red hat cartoon alternate dimensions OR worlds"