In that sentence, "He had a bad day" talks about the type of day the person experienced. "He had had a bad day" indicates that the experience occurred (and was completed) prior to another experience under discussion.
I had read several books that have "had had" and it confuse me. Is it possible and what is the xplanation on have it.
The verb "have" acts as an auxiliary verb for the perfect aspects/tenses.
The perfect aspects are formed using "have + past participle".
Now, keep in mind that "have" is a verb unto itself. When "have" functions as its own auxiliary in the past perfect, we can choose to leave out "have" as auxiliary so as to avoid the confusion that you are making reference to now. In this manner it is not the past perfect, but the simple past. Take a look at these examples:
Up until lunchtime, he had not eaten anything.
had - as auxiliary + not eaten - eaten as past participle - had not eaten
Up until lunchtime, he had had nothing to eat. (best example I can think of now)
had - auxiliary verb in the past to form the past perfect - + had - past participle - to form the past perfect -
The past form of "have" which is "had" is functioning as an auxiliary in order to form the past perfect with the past participle of "have" which is "had".
had/auxiliary + had/past particple = had had - past perfect aspect of the verb "to have"
We can leave out the first "had" and put the sentence in the simple past. The meaning is not changed in this manner.
Up until lunch time, he had nothing to eat. or He had nothing to eat up until lunchtime.