The cameo appearance in Avengers: Endgame was made more for the fun of it and because they couldn’t resist rather than any further thought put into it.
“It’s sort of the hippie era, and Stan’s cameoing as a hippie and it’s the free-love era,” Joe Russo explains. “He’s saying, ‘Make love, not war!’”
Visual-effects artists used the same technology they deployed to de-age Michael Douglas in 2015’s Ant-Man, strip decades off Kurt Russell in 2016’s Guardians of the Galaxy Vol. 2, and briefly turn Downey into a teenager in 2016’s Captain America: Civil War.
They didn’t get into the specifics of this particular technique, but by scanning Lee’s face, they could Photoshop away the years and make him look half his age.
“It seemed like fun when we originally had the idea, before Stan passed,” Joe says. “Oh, what did Stan look like in the ’70s?”
Entertainment Weekly, Avengers: Endgame explained: Stan Lee's final cameo
It’s worth noting that I don’t think they had the Infinity Saga really thought out by the time of Captain America: The First Avenger, never mind Stan Lee’s cameos, especially when you consider later comments. The idea of him being. Watcher/Watcher Informant was only introduced in Guardians of the Galaxy Vol. 2.
“I actually read the Marvel fan sites and the Marvel message boards out there and a lot of times people have ideas that are somewhat off-base or silly or whatever,” said Gunn. “But one thing I found very funny and interesting is the fact that people thought Stan Lee is a Watcher… and that all of these cameos that he’s doing are part of him being a Watcher. So I thought that was one of the greatest things the fans came up with.”
IGN, James Gunn Acknowledges Small Guardians of the Galaxy Vol 2. Continuity Error
"Yes, we always thought it would be fun. Stan Lee clearly exists, you know, above and apart from the reality of all the films. So the notion that he could be sitting there on a cosmic pit stop during the jump gate sequence in Guardians was something very fun - James had that idea and we shot that cameo and loved it so much, you know, you see it a couple of times in the movie. It wasn’t in for a long time and we put it back in towards the end of the process where he references that time he was a Federal Express agent - we thought it would be fun to put that in there because that really says, so wait a minute, he’s this same character who’s popped up in all these films."
ScreenRant, Kevin Feige Endorses Stan Lee MCU Cameo Fan Theory
And, lastly, and somewhat more importantly, the technology to de-age Stan wasn’t developed yet for Captain America: The First Avenger so they couldn’t make him look younger. I wouldn’t put too much thought into it to be honest.
I would say it could be explained away with that the Watchers can time travel (I think) but I don’t think it’s necessary.