The first ones are dummy devices who simply repeat the input signal to
every output port.
Right, more specifically, they copy the signal on all ports except the one the signal was received on
The anti-collision protocol CSMA/CD
Wrong, CD state for
Collision Detection, this is not an anti-collision mechanism. Collisions can occurs but are detected.
Such "anti-collision" mechanism exist, it is CSMA/CA (Collision Avoidance) and it is used in WiFi for example.
Switches are smarter and they manage the collision protocol.
I can't get this. I mean, we are dealing again with half-duplex communications? What changes if the CSMA/CD is implemented in the switch instead or in the NIC's device? If the switch implement the protocol-collision, means that the medium between the switch's port and the host is a full-duplex? Otherwise it should have again collision !
CSMA/CD is not located in a single place, the NIC or the switch. It is a protocol (think "language") known by both the hosts(computer NIC) and the switch.
Switches don't "manage the collision protocol". They do speak it and are capable of detecting a collision prior to decide to send the frame to the destination host.
You are right in that if the connection between a host NIC and the switch is full duplex, CSMA/CD is not needed since a collision cannot occur.
But the same port of a switch can be connected to a device that supports only half-duplex (increasingly rare nowadays) and in this case the switch port will automatically set itself to half-duplex (if it supports auto-negotiation) or can manually be configured for half-duplex. In this case CSAM/CD will be used.
Edit to respond to comments:
In a single collision domain (which is on a switch the host and the switch port), all hosts must be set with same duplex setting. This can be achieved either automatically with auto-detect if at least one host support it, or manually. But If one host is set to FD and another one to HD, problem arise. Still today it is not rare that duplex issue arise, and despite the fact that auto-detect is almost ubiquitous, from time to time we have to manually set a port to a given mode.
As explained by @Ron Trunk in his comment, each pair of [switch port - host ] is a single collision domain. So on a single switch you can have a port connected to a host in FD and another one in HD.
This is not, by far, the only difference between a hub and a switch. The major feature of a switch is that it records the MAC addresses of all connected devices, so it knows which MAC address is behind which port and it can forward the frame only to the appropriate port instead of copying it to all ports. (there's many answers on this site that deal with this aspect).