Dirt bikes are considered to be a motorcycle but unlike a regular motorcycle that can be and is meant to be ridden on roads and highways the dirt bike is made for riding off road.
Motorcycles are heavier than dirt bikes as well and while you need a motorcycle license to ride a motorcycle on highways and public roads you do not need a motorcycle license to ride a dirt bike on off road places.
That is why they are called dirt bikes which are a light weight motorcycle but are only meant to be ridden on the dirt and trails for fun.
Some people even ride dirt bikes as a sport and race them in dirt bike races.
I have ridden my dirt bike on the road here in our small town even though legally I'm not supposed to.
But I ride it with care too and from the store and the post office on nice days and the police in town do not say anything.
But if I were to ride the dirt bike in a bad way then I would get into trouble.
But some places may ticket you if you ride your dirt bike on the road without a license or tags.