I tend to get that on my shoulders with certain synthetic shirts. Since switching to merino t-shirts, it’s no longer a problem. Try hiking with wool socks.
A couple of other things you can try:
- If you hike with boots, try hiking with low cut trail shoes - it might be a sort of heat rash caused by the boots ankle collar.
- Put some anti-chafe cream on your ankle before you start hiking. Specifically ones with antibacterial properties.
Try one thing at a time so you can figure out what causes it by process of elimination.
Hope that helps.