In theory it should work if exporting from FCP using this preset:
File>Share>Export File>Settings
Format: Computer
Video Codec: HEVC (10-bit, HLG, Dolby Vision 8.4)
However there are many dependencies that can prevent seeing it as HDR on some common viewing methods.
To see the HDR as intended, you technically need an HDR monitor. However Apple has a new technology called EDR (Extended Dynamic Range) that attempts to tonally remap the image to newer Apple monitors capable of > 500 nits. This includes the Pro Display XDR, 27-inch Apple Studio Display, and the newer MacBook Pros with Liquid Retina screens.
Even between the Apple Studio Display (which has a P3-600 nit preset) and the Liquid Retina screen on the M1 and later MacBook Pro laptops (which have a XDR P3-1600 nit preset), there is a large difference in how EDR handles HDR content.
Above is from desktop testing. Mobile devices impose yet other behavior characteristics. The overall test matrix is very large to verify the particular flavor of HDR works end-to-end on diverse playback methods.
For HDR to work, it requires much more than a camera capturing it. The proper NLE settings must be used, the streaming service must support it, the monitor must support it, and the color profile selected on the monitor must support it. In some cases, it must be one of the above newer Apple monitors. If all of those are not in place, then each viewer who does not have that configuration will not see it as HDR. It looks spectacular on a M1 or later MacBook Pro with Liquid Retina display, but you can't expect all your viewers will have those.
The overall goal with the type of HDR called Rec.2020 HLG is for the image to "gracefully degrade" when viewed on a less-than-HDR monitor (almost all current monitors). However, in my testing, this does not always work well or predictably. Apple devices with the newer displays and when using playback software that understands EDR can look very good despite not being true HDR monitors. But that is still a small subset of all current playback devices.
The vast majority of this is not an FCP issue. All you can do with FCP is export using the above preset.
To make HDR work properly requires an end-to-end understanding of all elements and configurations in the pipeline from acquisition to playback. That is far beyond an NLE issue.