Use a Material File

You can make the texture be a parameter of the material, and create a dynamic material instance, and then configure a runtime generated (loaded) texture into that material.

A: terrain → material → Dynamic Material Instance (“MID”)
B: texture on disk → bitmap in RAM → Runtime texture
Configure B as the texture parameter on A. Done!

You may need to use a little bit of C++, but there’s reasonable suggestions of a few different approaches:

It mainly boils down to using something like Ramas plugin (or writing your own similar C++ code):