We need to setup provider hosted app in dedicated server and consume in Office 365. Is it possible?
If yes, then how we can take "ClientContext" to read/write operation to Office 365 Web list?
Yes , It can be done by following the steps we used to do with High Trusted Apps Deployment(Server to Server) in On Premises ,
Self signed certificate for your web app in local IIS
Register app using appregnew.aspx
Use the client secret and ID in the web.config
Please refer this for detailed info on this topic: https://bishwadebdey.blogspot.com/2016/01/step-by-step-creation-of-provider.html?showComment=1486621176030#c1394076155011092551
Yes it is possible. I worked on a provider hosted add-in which I deployed in IIS and was used by O365. When you create the add-in, give O365 site URL and log in. After that select SP Online as earliest version of SP that you want your app to target
. Next you can select Web Forms
or MVC
according to your wish and use Windows Azure Access Control Service (for SP cloud apps)
Now you can deploy the app wherever you want. Give URL of IIS website while publishing and make the domain public.
I am not going into detailed steps as you will find many links on internet like this
Regarding, ClientContext
use it in the same way as you will find in demo code which comes after the project is created. No difference.
Hope this helps!