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.
is a link to a high temperature water filter.