Generally not a very good idea.....EXCEPT,
If the flight is long range, and can be re-dispatched enroute, and the diversion (orginal, destination,alternate wx is within limits) AND most important, the dispatcher agrees, AND produces a flight plan accordingly, THEN, it can be done, for usually the reason to uplift more payload or mitigate high fuel cost.
By long range, six+ hours, generally.