There's lots of creative ways to keep rust away...Let's face it situations happen... The car is painted and now you've come across a hole that has too much paint in it and now you need to file it open for the screw/clip to fit...
All you can do is open it up and use some paint for touch-up...
Some factory body screws have the ends dipped in wax to seal the hole...Some clips and fasteners have a "seal" on it being foam,strip calk etc...
In your example using the hood trim you first need to verify it'll actually fit the holes without chipping the paint first...If it's going to make it then use some strip caulk{I like the 3m brand} on the screwclip for the front then use some on the backside for the nut...Essentially sealing the hole from both sides...Then just peel away the excess around the nut...
On some super tight clearances you could use a gun/tube caulk but that would be a one time deal on the install and could get messy depending on the situation...And once it sets there's no going back for an adjustment if need be..