Only if it contains a carbon cartridge. And then it won't do it for long until you have to replace the cartridge. That's IF you have H2S gas that is not caused by bacteria instead of naturally occurring H2S. IF you bacteria, the odor will get worse because bacteria thrive in carbon.
Or if the odor is only in the hot water, it is caused by bacteria, so the filter will not help unless it is on the outlet of the heater and then you need a hot water rated filter. Or, simply increase the temp of teh heater to 140f for a few hours and that will kill the bacteria but, if you decrease the temp, they will come back. Or remove or replace the anode rod with a different type material.