To answer this question, first we need to understand ADS-B OUT and ADS-B IN.
Then we come back to this question, Do all aircraft have ADS-B?
Air carrier aircrafts, with more and more countries require ADS-B, most commercial planes have ADS-B OUT functions, but still only a small part have ADS-B IN functions. Some very old planes don’t have ADS-B OUT functions, because
1. Before ADS-B became the factory standard equipment for air carrier aircrafts, old air carrier aircrafts did not have ADS-B equipment as standard. Many new air carrier aircraft are equipped with ADS-B as standard when delivered to airlines.
2. The equipment onboard air carrier aircrafts is cheap when configured as standard. If the equipment is installed after planes are delivered to airlines, it will be very troublesome and expensive for this installation. There are three major costs for retrofitting: equipment fees, losses caused by the grounding of the aircraft and retrofitting requires approval from Boeing or Airbus and revision of the manual.
3. Airlines will consider spending money to retrofit ADS-B equipment on old aircrafts only if they have requirements. For example, if they need to fly a route that has implemented ADS-B control, requires that aircrafts flying this route must have ADS-B OUT.
4. Strictly speaking, mentioned above are ADS-B OUT equipment and functions. Currently, there are very few airlines that are actually considering implementing ADS-B IN.
In simple words, old aircrafts before ADS-B became standard equipment on air carrier aircrafts were not equipped with ADS-B OUT. Adding and modifying ADS-B equipment is time-consuming and expensive, so airlines only do this when they have requirements. Under certain circumstances, airlines will gradually consider retrofitting old aircrafts with ADS-B equipment, which also requires time.
General aviation aircrafts, different from country to country. Some GA aircrafts have ADS-B OUT functions and some have ADS-B IN functions.
UAV/drones, some UAVs that need to fly enroute may be required to have ADS-B OUT functions. Some small drones, like DJI have ADS-B IN functions.