Will the heat flow of Joule heat be different, if the Joule heat is dissipated in a material that has a temperature gradient beforehand? Let us assume one dimensional heat transfer, for example a finite length wire starting at point $0$ and ending at point $\ell$. If the current passes the wire, the Joule heat $I^{2}R$ will be generated and dissipated into the wire and its thermal surroundings. Had the wire had a constant temperature $T$, the half of the power $I^{2}R / 2$ will be passing the left end, the other half will be passing the right end.
Will the situation change if the non-zero temperature gradient $\nabla T $ is present before the Joule heating starts? I cannot grasp, which principle has "higher priority" in this case - be it either principle of dissipation of heat which should be considered "a random walk" or the second thermodynamic principle which states that on average more heat will flow from colder to hotter parts.
Motivation for this question are heat transfer equations in thermoelectricity. Thank you in advance for any answer of insightful comments!
 A: As mentioned by Programmer, saying that if the wire temperature is constant then half of the heat will flow in either direction is incorrect. It really depends on the boundary conditions on either end of the wire (since it is of finite length). Assuming that the wire is at a spatially uniform temperature (not constant in time) and has same boundary conditions at both ends, the Joule heating will simply raise the temperature of the wire - uniformly. Heat cannot flow unless there is a axial temperature gradient in the wire. The temperature of the wire can then simply be modeled as:
\begin{equation} mc\frac{dT}{dt} = I^2 R \end{equation}
This assumes that the wire is not losing heat to its surrounding, otherwise a convection term needs to be added to the above equation. Next, say that the Joule heating starts with the wire already having a lengthwise temperature gradient. The flow of heat and development of temperature profile will be governed by:
\begin{equation} \frac{m}{l}c\frac{dT}{dt} = -kA\frac{dT}{dx} + I^2\frac{R}{l} \end{equation}
Again, the direction in which heat will flow really depends on your two boundary conditions.
A: 
Had the wire had a constant temperature T, the half of the power $I^2R/2$ will be passing the left end, the other half will be passing the right end.

I think this is a wrong statement. This is a common assumption used in a thermo-electric circuit theory to derive the equations. I would argue that this is valid in the case where the properties of the material  are uniform, or assumed to be, and had nothing to do with the temperature gradient. After all, in a thermoelectric material, you would not have current flow to begin with if you did not have a temperature gradient, as that is how the seebeck effect works. So how can you now turn around and assume that the wire has a constant temperature. 
Also, The joule heat is not something that is generated locally, it is generated over the entire volume. If you model the equations accurately, you can see it is far more complicated than you mention. I would encourage you to read, Callen, Thermodynamics and an Introduction to Thermostatistics ISBN-10: 0471862568
A: The question has several non stated assumptions and misconceptions (second law of thermodynamics says that in average more heat flows from cold to hot? No.)
You seem to describe two different situations. One in which you keep the ends of the wire at the same fixed temperature. In that case the Joule heat is going to modify the temperature of the wire in such a way that it will resemble a parabola, the temperature being higher in the middle of the wire (neglecting any thermoelectric effect, otherwise this will not be entirely correct). At any point inside the wire, there is a heat generated per unit volume equal to $J^2 \rho$ where $\rho$ is temperature dependent (in homogeneous and isotropic materials), so for a metal where the resistivity usually increases with temperature, the Joule heat will be higher in the middle of the wire in that situation. Fourier's law implies that this heat will be partly conducted towards the ends of the wire, in equal quantity yes, as you guessed.
However if beforehand there is a temperature gradient in the wire for example by keeping an end hotter than the other, and still neglecting any thermoelectric effect, the temperature distribution of the wire will still resemble that of a parabola but now the peak of the parabola will be nearer one end of the wire. More heat will flow towards the cooler end than the hotter end because the temperature gradient (roughly an inclined straight line) will be higher in magnitude close to the colder end than to the hotter end. So this answers your question, you were right in doubting that this would still be the case that half of the Joule heat flows towards each ends of the wire.
Now, if you do not neglect thermoelectric effects, then even in the simple case of keeping the two ends of the wire at the same temperature, the Thomson heat will cause an asymmetry in the temperature along the wire, which in turn will have an impact on the temperature gradient at each end of the wire, and they will differ. Hence the generated Joule heat will differ on each side and not exactly half of it will be conducted away through each end. There will be an asymmetry there.
