Yes, you can learn the same spell more than once if it is from different sources.
In the case you mention, you'd get hex as a racial spell and hex as a special spell from a feat. This same logic applies when learning spells from multiple classes: you can learn, for example, fire bolt both as a wizard cantrip and as an artificer cantrip.
Most times it won't make any difference: the spell works regardless of its source, although it would use the spellcasting ability tied to it when making a spell attack or using a spell save DC. (hex does not take the spellcasting ability into account; however, if for some reason it mattered, learning it as a warlock would use Charisma, and if learned as a spell for Fey Touched would use the ability score increased by the feat).
The only time the source of your spell matters is when a feature or trait (of any kind) tells you that you can do something special when casting a "category" spell. For example, an Artillerist Artificer's 5th level feature can give them an extra d8 to any damaging artificer cantrip they cast trhough a special focus; this bonus would not apply if they cast a wizard spell (a spell learned through the wizard class) or a spell learned through a racial feature or feat, because even though the spell is on the artificer list, they'd not know that spell as an artificer spell.
In your case it probably will not matter: you'd get two castings of hex without a spell slot each day, and — because it is the Fey Touched feat — you can cast it with your Pact Magic spell slots, even though it is not considered a warlock spell for you for features that ask you to cast a warlock spell.