Probably less than Muay Thai, more than BJJ. But I agree that striking is going to be safer than grappling in any non-organized fight. You don't want to take it to the ground if there's any sort of risk that somebody might jump in. Sparring in a controlled environment with gloves and headgear on is going to be very safe in general.
how much will you get hurt in boxing if you're a beginner?
Probably less than Muay Thai, more than BJJ. But I agree that striking is going to be safer than grappling in any non-organized fight. You don't want to take it to the ground if there's any sort of risk that somebody might jump in. Sparring in a controlled environment with gloves and headgear on is going to be very safe in general.