Post History
This is a legal question, and I am not a lawyer. So all of the following is my opinion, I am not giving you legal advice. If the character is not still under copyright, then sure. I am pretty sure...
Answer
#4: Attribution notice removed
Source: https://writers.stackexchange.com/a/32955 License name: CC BY-SA 3.0 License URL: https://creativecommons.org/licenses/by-sa/3.0/
#3: Attribution notice added
Source: https://writers.stackexchange.com/a/32955 License name: CC BY-SA 3.0 License URL: https://creativecommons.org/licenses/by-sa/3.0/
#2: Initial revision
This is a legal question, and I am not a lawyer. So all of the following is my opinion, I am not giving you legal advice. If the character is not still under copyright, then sure. I am pretty sure [Sherlock Holmes, as originally written, is no longer under copyright.](https://www.smithsonianmag.com/smart-news/sherlock-holmes-now-officially-copyright-and-open-business-180951794/) Otherwise, you are skating on very thin ice without written permission from the copyright holder (read that article about what WAS happening). If a writer fleshes out another character enough to be "recognizable" by much of the public (which is what you need for your cameo to make any sense), then the use of that character, their name, their description, etc is covered by copyright. Essentially, your use of that character improves the value of your story (or you wouldn't have included it), so you are making money on somebody else's work, which is the whole point of "copyright". Also, your portrayal of that character, since it is not done by the original author, has the potential to damage the character in the eyes of the public, no matter how well-intentioned you may be. What that character does, thinks, or dresses like or looks like is all the domain of the original author and any changes are subject to the approval of the copyright holder, and (in the USA) they could have grounds to sue you for damaging the public view of their property. So (In the USA and perhaps other countries with similar copyright laws) I would expect you to be sued for using any recognizable character, especially if you made any money by doing it.