Okay, I have tested now. I used ffprobe on my computer to check whether the video files I had where HDR, and they were not, so I downloaded a sample demo HDR video from internet instead. It shows up just fine in the GrapheneOS default gallery app, and plays back in HDR just fine. You can easily tell it is HDR because the bright parts of the video are much much brighter than the volume slider if you try to adjust the volume. The volume slider looks almost ghostly dark compared to the video when playing an HDR video, unlike if you play any non-HDR video where it just looks normal grey compared to the video. I tested this on a Pixel 7a, so it should definitely work on a Pixel 9 Pro too.
I haven't tested pictures, so please report back if you do. I am not aware of any picture formats that even support HDR.