It was precisely in the theater that the habit of calling a cameo the fleeting appearance of some famous person originated.
The origin of the word cameo is very interesting. It is remote in the nineteenth century where some theatrical performances in Britain began to popularize the fleeting interventions of famous people and were called cameo. In English, cameo is the word used to refer to a cameo.
Most of the time those appearances did not have any type of text in the work, but simply at a given moment of the same the character in question appeared at some point in the stage (either crossing, standing on one side or simply to make 'in bulk').
In television series cameos are also very common and are intended to attract the attention of the public. In any case, with this type of special intervention a special touch is added to a movie or even to a chapter of a television series.
Everything seems to indicate that the fact of using the term cameo (referring to cameo) comes from the immobile state (and usually in the profile) in which the guests seemed to make their small intervention in the works.
Despite coming from the same word, in each language they have their own way of calling cameo (camée in French, Kamee in German, cammeo in Italian, or cameo in Portuguese) but in the vast majority of countries (among which is Spain) have adopted the Anglo-Saxon term 'cameo' to refer to fleeting and sporadic appearances in some stage work. An example could be:
The Marvel universe, which is a true web of cameos and various winks between comics and movies, as we will see later. It is what can be called "metacinema": talking about cinema within cinema. Another example of this is the directors' cameos.
This happened with Stephenie Meyer, author of the Twilight saga, who appears in a cafeteria in the first installment.
There are many examples, but surely one of the most obvious is that of Erin Brockovich serving coffee to Julia Roberts (to curl the curl, Brockovic plays a waitress named Julia) or, more recently, to Jordan Belfort presenting Leonardo Di Caprio in The Wolf of the Wall Street (2013), a film based on his experiences.