Does Ohm's law hold in space?
But in space the resistor doesn't have anywhere to put off the heat!
Actually, it does. Heat transfer can occur by three means: conduction, convection, and radiation. Very basically, heat conduction is about solid materials touching each other; convection is about gases or liquids touching the heat source; and radiation is about transmission of energy by means of releasing waves or particles. (This doesn't capture all of it, but since you are asking this question, I get the feeling that you aren't very familiar with the subject, and this is hopefully good enough to get you started for the purposes of this answer.)
In an atmosphere, convection is commonly a major mode of heat transfer. It's how every air cooled gadget (whether forced air cooling or ambient air) remains at an appropriate temperature, and it's mostly the way everything eventually ends up at the ambient temperature.
In space, there is no atmosphere, so convection doesn't work for cooling. But there's still conduction and radiation.
Conduction basically just means that if you leave your spacecraft somewhere far away from any heat source, or in an area of uniform heat sources surrounding it, everything within it will eventually have the same temperature. That's not particularly useful for our purposes; in a spacecraft, it's more about heat transfer within the spacecraft structure than to outside of it.
But even with convection and conduction not providing any useful heat transfer to keep our resistor cool, there is still radiation!
And in fact, that's how spacecraft maintain an appropriate temperature: By carefully controlling the heat and energy budget, not uncommonly ensuring that all sides of the spacecraft are exposed roughly equally over time to the heat source (which in our real world cases means the Sun) and matching heat dissipation against heat generation through radiation of excess heat.
For this reason, spacecraft designs include radiators which take heat generated and radiates it into space.
In that case, will the resistor keep heating?
Yes, unless the spacecraft includes radiators or some other way to dump excess heat; which it will, at least if it is intended to work for any length of time.
Will that change its resistance in turn affect the $U=IR$ relation?
Yes and no! This has been pointed out several times in comments, but I see no answer capturing it. Regardless of how exactly it is phrased, Ohm's law is valid only for a snapshot in time. This means that for $U=IR$ to hold as stated, you must simultaneously measure two or three of the quantities involved (voltage, current and resistance); if you measure two, you can calculate the third.
The voltage that is lost through resistance across the resistor becomes heat, which (unless it is somehow released) increases the temperature of the resistor.
Real-world resistors have a tendency to change their resistance when their temperature changes, which means that $R$ changes. In turn, either the voltage across the resistor ($U$), or the current through the resistor ($I$), must change for the equality $U=IR$ to remain valid. But if you were to measure these quantities again a microsecond later, you would find that the equality still holds, albeit with slightly different values for each.
Ohm's law is only concerned with voltage, current, and resistance. In that respect, it is perfectly accurate and complete. However, Ohm's law is not all that comes into consideration for a successful design!
Even in real-world terrestrial applications, you need to account for heat capacity of the material conducting and dissipating the heat, and for the heat dissipation properties (get very complicated very fast; geometry, material properties, ambient temperature, air flow, coolant composition, coolant pressure, etc all come into play here...).
In mundane applications, measurements are often taken at 25C ambient to normalize everything. In that respect, you get fairly accurate measurements so long as the device being measured is capable of dissipating most of the heat it produces. In most applications the rest of the calculations are just not necessary, as the deviation from thermal variations are not enough to affect the mean significantly enough to warrant extra care.
In space, you need to figure out how to dispose (or recycle) every bit of heat you produce. Probes often have specialized radiator elements to radiate surplus heat produced into space. Surprisingly, heat dissipation calculations in space are actually easier, because the overall conditions vary much less than say the seasons on Earth. Also keep in mind conserving some heat is pretty much always mandatory, as many devices on probes could not function in the cold vacuum of space.
Edit
Since there is still confusion about, here is a small example to clear things up.
AWG 24 gauge copper wire at 25C has a resistance of 26.17Ohm per 1000 feet. Now let's say I drive a 100mA load @ 10V on that 1000 feet of wire. At room temperature, the voltage drop across the wire will be 2.617V. That translates to 261.7mW of heat produced. 1000 feet of AWG 24 copper wire weighs ~555g. Copper has a specific heat capacity of 0.376812J/(g-C). That means it will take ~209.13 Joules to increase the temperature of the conductor by 1C. Let's say our coil has the exposed surface to dissipate ~100mW of heat. That means there is still 161.7mW of heat working to increase the temperature of the conductor. 1W = 1J/s. 161.7mJ/s means that in 10000 seconds (~2.77 hours...) the wire will have increased in temperature by 7.73C. Still, if you were to stop time after those 10000 seconds, and start your measurements over, you would find that now with the wire at 32.73C, the resistance would probably be around 27 Ohms per 1000 feet. The load is still drawing 100mA, but the voltage drop is now 2.7V, so now the losses are 270mW. We still can only dissipate 100mW, so you see that it's heating up faster now.
Yet Ohm's law still holds. R is constant, it is always V/I, no matter what the temperature is. If you measure V, I, and R at the same time, at any point whatsoever, Ohm's law will always hold up. But in order to arrive to the correct real-world answer for a real world resistor, you also need to take into account heat production through loss and dissipation, which are physical factors, and have nothing to do at all with Ohm's law.
Diodes
Diodes are non-linear devices. Here are two graphs from the popular 1N4148 diode's datasheet:
From any point on those graphs you can figure out what the forward or reverse resistance is at 25C, for a given V and I.
One can always take a pedantic position and say that the Ohm law never holds as the resistor is always heated to some extent by the Joule heat (even if the resistor is cooled by air), and resistance typically rises with temperature. So the Ohm law is an approximate physical law. In some situations deviations from the Ohm law are very significant, for example in incandescent lamps, which is close to your "space" case.
On the other hand, the formulation of the Ohm law sometimes includes wording "in a given state" (https://en.wikipedia.org/wiki/Ohm's_law#Temperature_effects), but such formulation describes situations that are not seen often in practice.