They each have their dangers. How you go at it makes the biggest difference. I have raced/ridden MX for many years, but I'm new to HS. They are both a blast and very addictive.

If you are green as grass you should just go out and ride to understand the controls and get comfortable just riding. MX track, trails, doesn't matter where, just get familiar with your bike and riding.

MX can lead to jumping, which is a really fun thing. But, it requires lot's of practice to do safely and consistantly. Don't feel you have to jump to have fun on the track. Jumping is where you will most likely have serious injuries. Being a hero for a few seconds in the air isn't worth weeks in plaster(although I highsided out of a turn and seriously dislocated my hip once )

I highly recommend trying a HS race as a first time at racing. HS is a lot more relaxed than MX and it last much longer. Take your time and don't rush it. There will always be races.

One last thought. Any type of racing can/will lead to a lapse in concentration occasionally, usually because you get tired and stop thinking (your muscles take the oxygen your brain needs), it is at these moments that you run into problems, thats when being familiar with the bike pays off in saving it.

You can still have "moments" even when you thought everything was just fine (but that is another subject)

Good Luck!