Whether this is legal depends on local legislation. Your profile lists Belgium as your location, so I'll cite applicable law in Belgium (French law, which I'm more used to, is somewhat similar but not identical). In Belgium, the law seeks to balance the usefulness of surveillance to protect the employer and the employees with the employee's right to privacy.
The main applicable law is CCT 68 = CAO 68. Surveillance must be proportionate to the finality that is sought; for example, it the purpose is to protect against trespassers, filming the entrance to the premises would be valid but not filming employees' stations. Employee representatives must be informed before the cameras are installed, and all employees must be informed about the cameras, including where they are located, how long the recordings are kept and what the recordings may be used for.
It is legal for an employer to use cameras to control employees' work, but only on a temporary basis. Permanent camera installations may only be used to watch health and safety concerns, protect company assets and monitor machines. Permanent camera installations to monitor employees are not legal. Furthermore, employers may not evaluate the employee based solely on observations from cameras.
The limitation of this law is that it does not establish any penalties if the employer has violated these regulations. Evidence collected via illegal camera installations, or via cameras whose stated purpose does not include what the employee is being blamed for, is not automatically thrown out: a judge may decide to let it stand. Different areas of the law (e.g. civil law vs labor law) may have different standards as to what evidence is admissible.
In the case of your colleague, firing them for truancy while solely relying on evidence obtained via cameras would be illegal. On the other hand, using observations from temporary camera installations to build up suspicions and then verifying these suspicions by establishing by direct observation that the employee is not on the premises, would be legal. If the camera installations are permanent, then any use to monitor employees is in principle illegal, but if the employer is careful, their use can be hard to prove.
In any case, you are absolutely entitled to be informed about surveillance cameras. In fact, you shouldn't need to ask: your employer should have informed you about them. If this is not the case, contact your personnel representatives.