I want to change tyre texture when the wheel is on grass or gravel and then back to the normal texture when its clean again.
I don't think this is possible for the following reasons: AFAIK rF2 loads everything that's needed to race (all cars and track assets) into memory/vram on track load. Which means that your texture would have to be assigned to the shader/loaded into memory already. So, even if you could switch the texture on the application side, I don't think there's any way to get that to update in VRAM. Even if you created a new shader for the tires that had both the clean and grassy texture, you'd have to pass some custom data into the shader, which AFAIK isn't possible, currently. Hopefully this changes with DX11. If there is a way, and it doesn't cause issues, I'd love to know it as well.
Even if you could do it, you're be representing graphically a situation that isn't real; ie you would see a dirty tyre, but the physics side just has it as a normal tyre still. We could hope S397 will be willing to put in some fakery in areas like this, instead of the ISI approach of not putting in anything until it's done properly (ie gravel trap stone size, density, stickiness of tyres, leading to a certain amount of pickup at a given temperature with wheel rotation speed also factored in, then the individual stones factored into the contact patch grip calculations, and finally the stones being flung off due to centrifugal force as speed increases). A few simpler variables and a couple of alternative textures would do the job well enough (and maintain a correlation between graphics and physics).