Yes, a spacecraft in space can absorb heat from the Sun. In the vacuum of space, there is no air or other medium to conduct heat away from the spacecraft, so the primary methods of heat transfer are radiation and conduction.
Radiation is the main mode of heat transfer in space. The Sun emits electromagnetic radiation, including visible light and infrared radiation. When this radiation reaches a spacecraft, it can be absorbed by the spacecraft's surfaces. The absorbed energy increases the temperature of the spacecraft, and this heat can be dissipated through thermal management systems, such as radiators or heat pipes, which allow the spacecraft to radiate the excess heat back into space.
Conduction can also play a role in transferring heat from the Sun to the spacecraft, though it is less significant in the vacuum of space. If the spacecraft comes into physical contact with a solar panel or another object that is directly exposed to sunlight, heat can transfer through conduction from the hotter object (Sun or solar panel) to the spacecraft.
It's worth noting that spacecraft designers often employ various strategies to minimize heat absorption from the Sun and prevent overheating. They may use reflective materials, insulation, and specific orientation of the spacecraft to reduce the amount of solar radiation absorbed and manage the thermal conditions onboard.