Wild foxes can't be tamed – instead, you must convince foxes to breed Pokémon-style. This can be done by giving a sweet berry to a fox, and then giving another sweet berry to the fox you want it to mate with. After being given time to do their business, the foxes will produce a brand new fox who will be loyal to you.
Can a fox trust you?
The adult foxes are not tamable in the wild, but any babies that you help create will be born trusting you. However, baby foxes are still prone to following any nearby adult foxes, so attaching a lead is how you prevent that from happening. Once the baby reaches adulthood, it'll fully trust you.
Will a tamed fox Run Away?
Foxes will not follow you even when tame, but they will not flee from you when you are nearby like wild foxes will. If you want the fox to follow you then you will need to use a lead. If you are attacked though a nearby tamed fox will attack your pursuer, so they are loyal they just won't always be underfoot.