Collision domain is a set of LAN devices whose frames could collide with one another. This happens with hubs, bridges, repeaters and wireless access points as only one device can send and receive at a time. If more than one device tries sending or receiving, the information is lost and irrecoverable it will need to be resent. This can slow down network performance along with making it a security threat.
Broadcast domain is a set of devices that if one device sends a broadcast frame all other devices will receive that frame in the same broadcast domain. So if devices are in the same IP network they will be able to receive a broadcast message. Having a smaller broadcast domain can improve network performance and improve against security attacks.
A hub is an entire collision domain since it forwards every bit it receives from one interface on every other interfaces.
A bridge is a two interfaces device that creates 2 collision domains, since it forwards the traffic it receives from one interface only to the interface where the destination layer 2 devices (based on his mac address) are connected to. A bridge is considered as an “intelligent hub” since it reads the destination MAC address in order to forward the traffic only to the interface where it is connected
A switch is a multi-interface hub; every interface on a switch is a collision domain. A 24 interfaces switch creates 24 collision domains (assuming every interface is connected to something, VLAN don’t have any importance here since VLANs are a layer 2 concept, not layer 1 like collision domains)
In terms of current popular technologies: Any computer connected to the same Ethernet repeater or switch is a member of the same broadcast domain. Further, any computer connected to the same set of inter-connected switches/repeaters is a member of the same broadcast domain. Routers and other higher-layer devices form boundaries between broadcast domains.