The consensus is the real-life Nasrudin was a Sufi born in Turkey in the 1200s. But since he is known in folklore from the Middle East all the way to China there is obviously much debate about that. (Also about his name: Molla Nasreddin, Nasr Eddin, Nasrudeen Hodja, or just the Hodja, to name a few variations. The catalogers at the Library of Congress settled on Nasreddin Hoca.)
I don't claim to understand Sufism at all but I think it is a mystical tradition within Islam which believes enlightment cannot be achieved by study or words alone. It requires long-term commitment to a great teacher and one learns from the behavior of the teacher as well as from texts. There is an interest in achieving the conditions necessary for grasping truth, not in merely sitting down with a text. Everyone who has actually studied Sufism is now welcome to explain in the comments that I am full of beans.
Remember the old joke about the man who lost his keys at Point A but looked for them at Point B because the light was better there? Classic Nasrudin. And, if you think about it, clearly an allegory for the pursuit of truth (although, in proper mystical fashion, the message itself is debatable).
I had a friend who spend a year in Afghanistan several decades ago and he said that a day never passed without someone telling him a Nasrudin story. They were always told to make a point but they were so far from Western thinking that my friend sometimes could not tell when the punchline had arrived.
One day Nasrudin bought three pounds of meat. While he was out his wife cooked it and ate it. When he came home he asked where it had gone.
"The kitten ate it."
Nasrudin pulled out a scale and found that the kitten weighed three pounds. "If this is the cat, where is the meat? If this is the meat, where is the cat?"
One night Nasrudin found a burglar in his house, stuffing objects into a sack. Nasrudin immediately began to add more to the bag.
"What are you doing?" asked the burglar.
"I thought we were moving," said Nasrudin, "so I was helping you pack."
"Mulla, you are so wise! Has anyone ever asked you a question you can't answer?"
"Only once. It was: 'Why are you sneaking through my window in the middle of the night?'"
A woman came to Nasrudin's court and complained: "My son is addicted to sugar. I can't make him stop eating and he is spending all my money. Please order him to stop."
"This is a very difficult case," said Nasrudin. "Come back in a week."
She did. "This still requires more work," he said. "Come back next week."
This happened twice more. Finally Nasrudin called the boy before him. "You are making your mother's life a misery! I order you to stop eating sugar or you will be severely punished."
The mother thanked him. "But Mulla, why couldn't you have done the same thing weeks ago?"
Nasrudin shrugged. "How could I know it would take so long for me to give up sugar?'
There is a beautiful tomb in Aksehir, Turkey, supposedly that of the great Mulla. It is guarded by a gate, sealed with a great padlock.
There are no walls connected to the gate.