Yup, that is expected to happen. Its because Godot batches materials together for performance reasons, but when you modify one material all instances of that material get modified. The solution is just to make a duplicate and use it instead:
# load your image.
var image = load("res://Textures/tex.png")
# Get the 3D model
var mesh = get_node("MeshInstance")
# Get a duplicate material of the material in slot 0
# (New code below!)
var material_one = mesh.get_surface_material(0).duplicate()
# Change the texture
material_one.albedo_texture = image
# Reassign the material
mesh.set_surface_material(0, material_one)