Why hot water?
I've never heard the "hot" part, but gargling with salt water does draw excess fluid from inflamed tissues in the throat, making them hurt less.
It also loosens thick mucus, which can remove irritants like allergens, bacteria
from the throat. It's a temporary fix, since it does nothing to remove the cause (whatever that is), but it will make you feel better for a while.