Yes, you can absolutely hug your boyfriend during your period!
According to existing information, during menstruation, you can do anything you normally do, and this includes hugging, kissing, and sex. There's no reason to avoid physical affection like hugs simply because you're menstruating.