General regularities of the microstructure formation during friction stir welding and sliding friction