Dipukul = You were hit (on purpose by another person). The prefix "Di-" here indicates passive/past tense for the action verb "pukul".
For example, "Aku dipukul oleh kawanku" which means "Your friend hit you."
Terpukul = You hit, or another person hits you accidentally. The prefix "ter-" is used to indicate an accidental action.
For example, "Aku terpukul kawanku" which means "I accidentally hit my friend".