it could be a mole, or it could be some kind of tick or flea. Since it has been there for years, obviously it wasn't very harmful. More than likely your dog was scratching behind his ear and nicked it open with his claws. Just hold some tissue to it until it stops bleeding. It should just scab over in a few days unless your dog continues to scratch.
You can help the HubPages community highlight top quality content by ranking this answer up or down.