The correct option is
D So do I
Here, the subject in 'A' is saying something and the subject in 'B' is responding. In the response, the subject in 'B' can either agree with the subject in 'A' or disagree.
Option A is incorrect. In 'I don't either', 'either' indicates that the subject in 'B' is agreeing with the subject in 'A' but, 'I don't' indicates disagreement. Thus, the sentence is agreeing and disagreeing at the same time which does not make sense.
Option B is incorrect. 'Neither do I' is an agreement response for a negative sentence. Since, the sentence in 'A' is positive, 'Neither do I' cannot be its response. It will indicate that the subject in 'A' did not hope for Mary's well being in the first place. Thus, it is incorrect.
Option C is correct. 'So do I' is an agreement statement used in response to positive sentences. It indicates that the subject in 'B' also hopes that nothing has happened to Mary, thus, agreeing with the subject in 'A'.
Option D is incorrect. 'I hope to' is not a agree/disagree type of response. It cannot be used to agree or disagree with a statement but is generally used to respond to questions. Thus, it is incorrect.