There is no explicit legal norm, but that doesn't mean it's legal...there is § 168 StGB.
I don’t know, seems like that leaves some loopholes, you just have to get pre-death approval ;)
> (1) Whoever unauthorizedly takes away from the custody of the entitled person the body or parts of the body of a deceased person, a dead corporeal fruit, parts of such or the ashes of a deceased person, or whoever commits insulting mischief thereon, shall be punished by imprisonment for not more than three years or a fine.
translated from https://www.gesetze-im-internet.de/stgb/__168.html
I was thinking more of the situation of a person who’ll soon die (but is mentally capable) gives permission to be eaten after their death. Sittenwidrig would be another issue, I agree.