There is some speculation about who actually made the first dirt bike, but it is believed that it was Alfred Angus Scott. He was the designer of the Scott motorcycle, which was built in the early 1900s.
The Scott motorcycle was originally built to withstand rocky sections of land, English terrain that was rough and rugged, and stream crossings. It was not intended to be used for top speeds, but it ended up being used during one of the very first dirt bike races, called the Scott Trial. This included a time limit and various obstacles along the course. The winner of the race was the person who made the fewest mistakes in the shortest period of time.