Yes its origins are nothing to do with Rangers and Celtic. When I was a boy it just meant "the enemy ". For example in Ayr the Ayr Bruins (formerly Ayr Rangers) fans used to sing "Go home, ya huns" at Fife Flyers or whoever. Ayr and Killie fans sung it at each other. And no doubt others. It doesn't offend me at all.The Germans were called ‘H*ns’ by British newspapers before WWI due to their aggressive behaviour in China.
The word then stuck in the minds of ordinary people. It was the standard derogatory term for Germans during the Second World War.
Afterwards it gradually became a more general term of abuse. The writer Alan Spence - a Rangers fan from Kinning Park - describes a scenario where Rangers supporters refer to a barman by the word.
The meaning and use of words changes over time and most people who use ‘h*n’ will not be aware of its origins.