Yes, it is perfectly healthy and safe. Some dogfood has rendered meat product in it which is dead, rotting farm animals and pets that are sterilized and ground up. In that case you might not want to eat it, but it won't hurt you.
i think its alright for you health-wise as long as it doesnt become or isnt currently a habit(might want to get that checked out if thats the case) but if it was accidental, or a one time thing i dont think theres anything to worry about