Is there a compass sensor or a software emulating a compass in each Android smartphone? Or maybe is there a solution for it problem starting from Android 4.0 ICS?
No, not every Android smartphone has real compass (magnetometer) sensor. Even Google claims that,
Few Android-powered devices have every type of sensor. For example, most handset devices and tablets have an accelerometer and a magnetometer (which refers to compass usage on latter text), but fewer devices have barometers or thermometers.
(Emphasis mine for added info)
Note that Google specifically says most handset devices, which should include most (but not all) phones and tablets.
As for software emulation, I haven't found any method that can emulate compass without magnetometer, and thus, I concluded that it's impossible for now.
The conclusion is, since not all Android handsets has compass sensor/GPS receiver, and there is no way to emulate compass without them, the answer is: No, not every Android smartphones have compass feature.
You probably have a compass built in, try looking for it in the specifications of your phone (a lot of sites list them). As to use it, you can install an app from Play store, there is plenty of them, just search 'compass'. It may be that some of them use other data sources (internet, geoloco, ...) to make up for the absence of a specific compass sensor.