The question is, when I plug previously prepared (e.g. with hello world script) Arduino nano in usb port for the first time to a new computer, what exactly happens? Does it start to require its own drivers to be installed and then executes compiled code or does it behave like other usb device and do not require any kind of special drivers, so it can communicate with the computer for example, as hid device? Can someone help me understand it, as I'm new to the Arduino?
You need the drivers only for serial communication. So for e.g. the blink sketch, you don't need it.
When an Arduino is powered up it starts running any sketch that it has loaded in it. One way of powering it up is by plugging it into a computer USB port. If the Arduino sketch causes it to communicate over USB then that's what will happen. Whether you see anything at the computer end will depend on what program is running over there.