What is the relation between the power dissipation in resistor and the temperature rise
The relationship in both cases is Temperature Rise = Power * thermal resistance.


Tj-Ta is the temperature rise (from "junction" to "ambient)
theta(ja) is the thermal resistance.  And the assumption is that the data sheet gives you this value.


This relation works just like E=IR only it's temperature and heat instead of voltage and current.  The relationship you gave for the transistor is in a less useful form for this purpose.  You want to apply a little algebra and thus come up with:

Tj-Ta = Pd * theta(ja)

This works for resistors as well, assuming the data sheet will give you a theta value from the resistor body to air.  That's the equivalent of junction-to-ambient.  In all but high-power pulse operation, it's just assumed that the resistor transfers all of the dissipated power to its body, and you only worry about how it transfers to the surrounding air.

Actually, in the real world, both the resistor and the transistor can transfer a considerable amount of heat out through its leads (or pads).  Since your stated equation only mentions junction-to-ambient, that's all that's addressed here.

If you can't get a theta value, you'd have to come up with an allowable maximum temperature for the resistor, and use the resistor's stated power rating to arrive at a value for theta.