The scene in which Lenny Bruce does his act in a raincoat, near the movie's end, came from a Lenny Bruce show that a student tape-recorded and sent to Dustin Hoffman. Bruce's lines are directly from the tape.
When Lenny picks up food at the Chinese restaurant, the proprietor inquires about his "wonderful wife". Lenny replies, "We're divorced." He responds, "You're better off." Lenny Bruce used this as a joke in his stand-up routine.
The character Sherman Hart is based on the legendary comic Milton Berle. His real name wasn't used because Berle was still alive and there were fears he would sue for libel. The character uses most of Berle's mannerisms and trademark shtick, including sticking a cigar under his top lip.
Al Pacino was offered the role of Lenny Bruce but turned it down. He said on The Larry King Show many years later that this was his only career regret after seeing the movie.