It depends.
I many states it is pretty easy to get a license on a dirt bike. You just need to install the legal hardware like lights and turn signals and pay the fees. Some enduro or trail bikes may even come with some or all that equipment. In other states they are much more strict and require emissions equipment and the model has the be legally designated a road going motorcycle. These models have the necessary equipment from the factory.
Dual sport motorcycles start at 200cc and go up to about 650cc with some dirt worthy twins even bigger. Bikes from KTM, Aprilla and Husky are basically street legal dirt bikes that offer high performance off-road but are expensive, require more maintenance and may not be well suited for street use. 200cc and 250cc air-cooled bikes are inexpensive and easy to learn but may struggle some at highway speeds.
Off road light weight is better, especially for a beginner. The more capable 250cc and 400cc bikes are often recommended. If you intend to do more road than off-road miles the 650cc bikes are better. The upgrade path is usually converted off-road models or the European models.
Lots of choices. Look up the KLX250s, WR250r, DRZ400, DR650 or KLR650 from lightest and lowest power to largest and most power.
Craig