"Despite" is used to indicate that an action is taken in spite of a particular factor, in this case, the rain. The other options do not convey the intended meaning as well:
(B) "in spite" is similar to "despite" but is not commonly used in this sentence structure.
(C) "under" suggests being beneath or covered by something, which does not fit the context of going to the park in the rain.
(D) "avoiding" implies actively staying away from, which is not the intended meaning in this sentence.
Therefore, (A) despite is the correct choice to convey that they went to the park in spite of the rain.
Doubts & discussion
Not sure why the answer is A? Ask here and get an explanation.