I am planning to develop a free app. Which could be useful for many people. So, I am planning to put a donate button inside my app. So if any people finds it useful, they will donate for development.
Is it good if we implement in app purchase to achieve this functionality.
I am not sure is this possible. Please correct me if this question is wrong and I will remove it.
Thank you in advance.
Try to search. There are multiple questions on how to handle donations.
You have to look for App Store Review Guidelines https://developer.apple.com/appstore/resources/approval/guidelines.html
See 11.2 - 11.4 and judge if donation to non-charities (Charities covered in 12) are allowed:
I would say no. This is virtual goods not consumed inside the App.
To work around it, let people pay for a different background color or some minor functionality such that you can stay in compliance. Or make 2 versions, telling them to support development by buying the other version (you can link to it). The 2 versions could probably be the same or almost the same.