At episode one of Season 2 of Lucifer, he told the detective that doesn't it feel good to be back on set? And mentioned some movie she acted in in the series. The hot tub thing. Does he know they are in a TV series or something?
No, though that line was likely meant as an joke, it has a completely in-universe explanation.
Before she became a police officer, when she was still young, Detective Decker (the character) was a teen actress. She was especially famous for starring in a low-budget teen movie, called Hot Tub High School (I assume it's a Fast Times or Summer School or similar movie). Her claim to fame is appearing topless in the movie.
During the episode you're talking about, Chloe and Lucifer were investigating a murder that happened on a movie set, so she was "back" on set after years of being away from it. He was gently ribbing her over her prior acting experience, because it's something she's uncomfortable with and is largely trying to put behind her.
This is a type of joke known as lampshade hanging http://tvtropes.org/pmwiki/pmwiki.php/Main/LampshadeHanging or leaning on the fourth wall. http://tvtropes.org/pmwiki/pmwiki.php/Main/LeaningOnTheFourthWall It is meant as a wink wink nudge nudge to the audience, without breaking the fourth wall, and thus the illusion of reality. While the joke works in-universe, it also applies out of universe.
In the source comics that the show is VERY loosely based on, Lucifer does indeed know he's in a book. But those comics also work on the concept of a multiverse, where Lucifer is in one universe as real, and in the other, i.e. ours, as a comic character. He regularly talks to/at the audience.
The show Lucifer has not yet implied to know he's a TV character. He's not Deadpool after all.