Yes, your technology equipment needs to be able to get fresh air like us humans needing to breathe. When technology gets too hot, things can just shut off. It can be a bad thing. For example, if you’re writing a letter on your computer and the computer shuts down, the letter can become corrupted. If your device is performing updates and turn offs, this can cause the device to become unusable.
You should not use your laptop in bed. Most laptops have their fans on the bottom or on one of its sides. Comforters and large blankets can block the fans, making it hard for the laptop to stay cool.
Desktop computers should have an internal cleaning. Dust can accumulate inside of the computer, causing the ventilation system to not run well. I recommend opening a computer every year or two, and vacuum the insides out. Be careful not to unplug or move anything but also note that the inside of a computer should not fall apart if you use a vacuum cleaner hose to clean it.
Most mobile devices do not have a good ventilation system. You should not run into a problem when charging them, but because they have a tendency to get warm you should not overuse them while they are charging. Just like a regular computer they have a CPU and power source that gets hot. Since they don’t have a good ventilation system, they could get hot, causing damage the mobile device.