The order parameter of some martensitic phase transition in a crystal in general couples to the elastic distortion field of existent dislocations, or via a contact potential to twin boundaries. As a consequence such extended defects can in some temperature range around the transition point be coated by nuclei of a globally unstable phase. For a moving defect the continuous dissipation of energy into the attendant nucleus generates a viscous-friction force. If the transition is of first order, an additional dry-friction force appears in the hysteresis temperature range due to phase transformation into a metastable trail behind the defect. However, until recently these phenomena have only been discussed for straight dislocation lines moving at a constant velocity, disregarding implications of line- and order-parameter fluctuations. Allowing such effects, we have recently shown that the glide motion of a dislocation close to a first-order phase transition obeys a Kardar-Parisi-Zhang (KPZ) equation, supplemented by a dry-friction force. We argue that, due to the competition between the KPZ nonlinearity and the dry-friction term, the dislocation line develops a zigzag-like roughening behavior. In addition we show that in some range of the material parameters the viscous-friction term alone can give rise to a shape instability of the dislocation line which is totally different from the previously discussed roughening instability. Whereas the latter evolves from local changes of the slope of the line (relative to the Burgers vector), the new instability is initiated by local velocity fluctuations (which simultaneously involve curvature fluctuations). In fact, due to a finite relaxation time for readjustments of the nucleus, a local acceleration of the defect reduces the nucleus size, and consequently lowers the strength of the viscous-friction force. This in turn generates an increase of the local defect velocity which then proliferates in a self-amplifying way. Opposite to this, the line tension tries to stretch the defect, and, competing with the former effect, excites an oscillation of the dislocation line at the instability threshold.