She went to the park with him.

Literal

She [topic-は] he [with-と] together park [to-に] went.

Two distinct uses of two different particles: 彼と marks the companion (with whom), and 公園に marks the destination (to where). Using に on 彼 — 彼に行った — would shift the meaning to 'went to him,' not 'went with him.' The choice of particle is what tells you whether someone is a partner or a destination.