Protection from red has four components, remembered by the acronym DEBT: the creature cannot be Damaged, Enchanted/Equipped, Blocked, or Targeted by anything red (CR 702.16b). Your question actually involves two separate checks.
First, if the red spell itself does not target the protected creature, then the targeting restriction of protection is not violated. You can legally cast a red spell that creates a token, even if you intend that token to attack or deal damage to the protected creature — as long as the spell's targets do not include that creature (CR 115.1, 702.16b).
Second — and critically — even though the spell resolves fine, the damage component of protection still applies. All damage dealt to the creature by a red source (including a red token) is prevented (CR 702.16b, 120.3). A token's color is determined by the effect that created it, so if a red spell creates a token, that token is typically red and its damage to a creature with protection from red is fully prevented.
Concrete example: You cast Dragon Fodder (a red spell) to create two 1/1 red Goblin tokens. The spell doesn't target anything, so it resolves normally even with a creature with protection from red on the battlefield. However, when those red Goblin tokens attack and deal combat damage to a creature with protection from red, all that damage is prevented — the protected creature takes zero damage.
In summary: you won't be stopped from casting the spell or creating the token, but the damage the red token deals to the protected creature will always be prevented by the protection ability.
Unofficial fan resource — not affiliated with or endorsed by Wizards of the Coast. Answers are AI-generated estimates grounded in the Comprehensive Rules and are not a substitute for an official judge. Verify anything match-critical.