Dealing with my daughters behavior

My daughters behavior is starting to interfere in our daily lives. She is 4 years old and her behavior is becoming overbearing. She will backtalk, hit, scream, and just not listen at all. We have took toys, whooped her, done timeouts, tried to sit her down and talk through her emotions with her. Nothing helps, she goes right back to what she was doing as soon as she is disciplined. For example yesterday we had guest over and she ran over and hit them, I took her out of the room and whooped her. She started crying and told me she was sorry. Not even 3 minutes later she ran back in here and started pulling my hair and went and smacked dad in the face. And this is a all day cycle with her. She has never been exposed to hitting or violence so I’m not sure why the hitting is a issue. From the age of 18 months she would bang her head against doors, headboard, etc. being frustrated, then started pulling her own hair. Her doctor said it was just how she dealt with her frustration, so I think maybe the hitting could also be the same? She will not listen to a word we say, for example we take her outside and she makes a run straight for the road. When we remind her everyday before we go out the dangers of running towards the road and why we don’t do it. I’m frustrated at this point and really just need some guidance on what we can do different being that no other punishments faze her.