1. Ulleongdo is 87.4 km away from Dokdo.

2. It is 87.4 km away from Ulleongdo to Dokdo.
3. It is 87.4 km from Ulleongdo to Dokdo.

(Are they all grammatical?)

1 and 3 are fine.

With "from" in the sentence, "away" is unneeded.