I know that I can read RPi temperature through console, but I’d like to measure it using a standard, hardware thermometer. Is this possible?
Can I attach thermocouple directly to the RPi’s processor as shown in the below pictures:
Or am I risking some electrical problems on can endanger my device in any other way?
There’s nothing wrong with putting a thermocouple on the chip heatsink like this. You can still damage the Pi if the rest of your setup is inappropriate: for instance if your thermocouple wiring is exposed to ESD or it is powered by a non-isolated power supply (though in the latter case I would worry about my own health more).
If the temperature sensor is connected to a battery-powered equipment (a multimeter) or to equipment powered by a class II power supply (⧈), you should be fine.
You won’t get much precision unless you provide a good thermal contact with the chip (thermal paste), and you should still expect a difference of some 2..10 degrees between the temperature inside and outside the chip (inside is hotter).