It is highly dependent on the situation honestly.
Dirt bikes can go faster and further than a horse, people can also become very complacent about how 'safe' dirt bikes are. People are also to likely ride the dirt bike on a main road where they would not venture with a horse. People often flip the bike, get run over, or have accidents on dirt bikes. There is an average of 245 deaths per year from dirt bikes alone and an estimated 4,462 per year for all motorbikes.
Horses are large animals with a flight instinct and don't always act predictably. A horse can buck, rear, bolt or flip over in an instant if they feel threatened. They may also go on the attack either on purpose or out of fear and hurt a human. There is an average of 100 deaths per year caused by horses in all activities.
it depends what your doing, with the bike and the horse but I would have to say horses are more dangrious beause they are unpredicktible and you can't always control them like a bike.