Hodja is a local rendition for "haji" in some Turkmen dialects. It just means someone who'd gone to Mecca to fulfill the obligation of the hajj pilgrimage. Nasreddin Hodja just means the haji Nasreddin. The old man hodja here is probably just a haji in the same way.