In general. Yes you can.
Open office is open , thus you can by browsing it s code you can learn how ODF s are created and kept. But you should find specification of all open office documents, it s out there, and it s a reason why all open offices documents have been granted ISO standard a while ago.
I think there should be a plenty of already scripts that are converting doc to odf, pdf to odf, backwards and etc, try googling for your favorite php/python/ruby/java/other script that provides such solution. Maybe there is even a solution that is changing PHP s object into doc/odf/pdf format and let to convert one format into another.
Editing it in a browser that is much harder and requires a lot more work. But google docs shows it possible.
In few words, a lot of work, and some work already done by community. Need to a google bit to find that pieces.