If you're replacing the entire lens housing with a DOT-approved housing designed to reflect/project an HID light source using D2S or D2R bulbs, then yes, it's legal. This is also normally prohibitively expensive.
I'm referring to re-based bulbs designed to fit into a non-HID housing, like 99% of what's sold on the internet. These are not, and woefully underperform the optics of a proper halogen bulb in the same housing. Note that brightness is far from the only performance metric in this scenario.