I’d consider what you’re trying to achieve in functional terms. How much weight will you save and how much real difference will that make on roads, which seems to be you main terrain? You might get better bang for your buck by simply investing in faster rolling tyres – obviously depends on what you’re running currently. Having a lighter fork will maybe make the bike feel nimbler and a little quicker off the mark and, I guess, if you don’t have a full lockout, will make for easier honking out of the saddle, but it won’t somehow make your bike feel like a lightweight road/gravel machine. It’ll also make it less able on more technical off road stuff.
I fitted one of the classic old On One 26″ carbon forks to an old hardtail frame and ran it 29″ front, 26″ rear – it still handles 29″ wheels with big tyres no problem and has a shorter axle to crown measurement than 29″ forks – it saved a bit of weight and was fine on smoother stuff, but it did lose some trail capability.
Anyway, sure you can do it. Just find a compatible fork with a similar axle crown measurement to your sagged suspension fork and fit it, but for road use, tyres first would be my take.