I can't think of any logical explanation. It is best just to memorize the commonest usages, and say "in" with wind and "on" with sun.
Here are some ideas. If they are helpful, good. If they are not helpful, ignore them.
"In" carries the idea of direction.
"On" carries the idea of spreading something over a surface.
No, you cannot say "I have the sun in my back." We think of light being a kind of covering. It is like paint or clothing. I put paint on a wall. I put a shirt on my back. I put sunblock on my back.
When the sun shines on my back, the sun spreads over my back like a covering. If I get too much sun on my back, my back will get sunburned. If I spread sunblock on my back, then the sun on my back will be blocked and I will be protected from sunburn.
However, we can say "I have the sun in my eyes" because the exact direction matters. If I am facing southeast and the sun is high in the south, then the sun is shining on my face, but it is not shining in my eyes.
With "wind" the word "in" is used when we are thinking about the wind direction. If the wind is from the east, and we are facing east, we have the wind in our face. If the wind is blowing from the right direction, it fills the sails of a sailboat. The sailboat has wind in its sails.
We can say we have the wind "on" our face. It's less common. It suggests air is moving and cooling us, regardless of the exact direction.
I could say "It's windy today. I'm wearing a jacket to keep the wind off me. But my face isn't covered. I am still getting chilled by wind on my face."