You mentioned, your problem stems from the sand/grit from the anode rod in the water heater.
A filter BEFORE the pump (like you asked) won't eliminate that debris from coming out of the tank and going into your plumbing because the debris originates from the water heater itself. It would only filter the water going into the tank. Same goes for a filter AFTER the pump.
You would have to put a filter on the outlet side of the water heater to catch that debris and BE SURE it is rated for the high temperatures seen at the water heater outlet.
EDIT:
*HERE* is a link to a high temperature water filter.
__________________
2022 Cedar Creek 345IK 5th Wheel•Solar & Inverter•2024 Ford F-Series SCREW•7.3L•4x4•Factory Puck•B&W Companion•TST Tire Monitor w/Repeater•Sinemate 3500w Gen.
F&AM Lodge 358 Somerset, PA - JAFFA Shrine - Altoona, PA
Days Camped ☼ '19=118 ☼ '20=116 ☼ '21=123 ☼ '22=134 ☼ '23=118☼ '24=90