Is it possible to create adhoc network programmatically in the iPhone, So that other device can connect to it?
Without jailbreaking it; no. If your phone is jailbroken and you want to know how to, Google has lots on it, but if that doesn't work out, update your question and be more specific.