Multicasting and broadcasting are at lower layers than UDP. UDP is used as a transport protocol for multicast and broadcast because it is connectionless. You could use any connectionless transport protocol, but NAPT has limited the IPv4 Internet to TCP and UDP, but TCP is connection-oriented, so it will not work with multicast or broadcast.