To dream that you are being attacked by someone means that you are afraid of something. The dream in which you are the one who is beating the other person means that you have anger issues that causes many problems to you. You shouldnt keep the negative emotions, because it shows that you are going to become an angry person.
Beat (attack) dream meaning
Read more about dreaming of Beat (attack) in other dream meanings interpretations.