Foot odor can be quite embarrassing and also a consequence of sweating. The first thing you want to do is make sure your feet are washed and clean before you wear the socks and shoes for your hike.
You also need to make sure that you wear clean, dry socks. Change your socks often and wash them when you do.
You can also make sure that you look for socks that are great at keeping moisture away from your feet. The longer your feet are wet with sweat, the more they will smell.
You can also make use of foot powders that dry your feet. If you know that you are prone to sweating and foot odor, make sure to put the foot powder on religiously before wearing the shoes and socks.