Hitting is usually a learned behavior, but also something natural that a child does at this age (they are going to see someone do it somewhere)--my son did it too,--the important thing though for you to do as a parent, is to stop this behavior and teach him it is wrong--, because if he isn't taught that it is wrong, he will keep doing it at 2, 3, etc.
At 17 months old, they have learned about cause and affect and reactions to things. I know when my son was that age, he thought the reaction to him hitting was funny--not realizing that it wasn't funny, it hurt,and was unacceptable.
You need to make clear to him that hitting (you, himself, others, etc), throwing toys, and heading butting is totally unacceptable behavior. Easier said than done with a 17 month old, huh?
You can do this by first doing what you are already doing--not hitting him or showing him that this is acceptable behavior by anyone --kids do model what they see--so this also means no TV show should be on in front of him nor video games (no matter how uninterested he seems)that has any sort of violence. And of course, he shouldn't be witnessing anyone hitting anyone else. Yes, it does happen, and yes he will eventually see more and more of this, but you can't explain to a 17 month old that it's wrong and why--so try to keep it away from his sight until these become concepts he can grasp.
Second, you want to dissuade him from doing the behavior and reward him for behaving. So if you are playing with him and he suddenly decides to hit you or head butt you, you immediately stop what you are doing with him, say "ouch, that hurt mommy--no hitting" and DISENGAGE with him (walk away, read a book--ignore him for a couple of minutes, at least). A 17 month old wants your attention and not getting it will give him a clear sign that what he did will cause this. If he gets upset--good--this means he understands! -it will take repetition and consistency on your part though so he can see the cause and affect of what he does. Once you disengage with him a few minutes, tell him that he can gently touch mommy (show him with his hand) or hug mommy, but no hitting or mommy will stop playing with him...then give him a hug, and continue to play with him....he will soon figure out that hitting mommy--means no playing, and will stop.
To stop him throwing toys--give him a warning after he throw one--no throwing your toy or mommy will take it away--and if he throws it again--take it away (and keep it away for at least the rest of the day). Rinse and repeat--our son stopped throwing his toys in a matter of days....
Some moms may also recommend classic time outs at this age, but I know at least with my son, that he wasn't ready to grasp that concept yet. By the time we brought him to the time out area and made him stay there for 2 min, I don't think he understood what it was for. We also didn't have much reason for discipline at this age, except for these two behaviors, so the immediate response of either disengaging with him or removing the said toy, just sunk in faster. We started implementing timeouts right before he turned 2, and still do now, and they work great though-
Whatever you do, do not tolerate these behaviors and make it clear to your son knows that you don't tolerate it!
Remember, no positive reinforcement for these behaviors from anyone--no laughing, etc. just a stern look and a solid "no throwing or ____ (time out, it gone, etc)' and then stick to it.
I don't know what to say about him hitting himself. My son did it some too-especially when he got frustrated with himself. I would just ignore the behavior and see if it gets resolved by resolving some of the other issues. My son is 2 1/2 now and doesn't do it anymore, but it wasn't anything we addressed specifically, he just eventually stopped.
Finally pleas don't feel guilty! You are not a bad parent--you just have a toddler and they can be very trying at times! He is his own little person--just remain strong and consistent with him on what you find acceptable and not acceptable.