Is it possible to write into a texture or change vertex color in game?

Is it possible to write into a texture while in game, or to write into vertex color around a raycast or something like that ?

I would like some kind of terrain deformation and wanted to do it using shader. At first i tried by using the terrain (landscape) but couldn’t find anyway way to get it to change in realtime.

thank you