Stan lee's cameo in the Marvel Cinematic Universe are as follows -
In Iron Man (2008) Stan lee appears with three blonds to resemble Hugh Hefner.
In The Incredible Hulk (2008), Lee appears seen drinking soft drink mixed with Bruce Banner's blood.
In Iron Man 2 (2010), Lee is greeted by Tony Stark as "Larry King".
In Thor (2011), Lee appears among many people at the site where Thor's hammer Mjolnir lands on earth. He tears the back off his pickup truck in an attempt to pull Mjolnir out of the ground with a chain and causes everyone to laugh by asking, "Did it work?".
In Captain America: The First Avenger (2011), Lee portrayed a general in World War II, who mistakes another man for Captain America/Steve Rogers, commenting, "I thought he'd be taller."
In The Avengers (2012), Lee makes a cameo appearance as a random citizen in the park asked about the Avengers saving Manhattan. Lee's character responds, "Superheroes in New York? Give me a break", and then returns to his game of chess. He also appears in a deleted scene, apparently as the same character: when a waitress flirts with Steve Rogers, he says to him, "Ask for her number, you moron!" (source:Wikipedia)
So these random appeararances conflict with the shared universe, especially for the case of Captain America: The First Avenger.
So how does Stan Lee's random appearances work in the Marvel Cinematic Universe?