Are they actually legal?
Generally those kind of scams setup an illegitimate transaction that would be reversed in a court case.
Whether they rise to a criminal matter is complicated but the vast majority of such scams hold up to scrutiny and instead rely on shell games to make retrieving your funds to expensive to be possible.
Germany follows the law extremely strictly, even more than the USA. If there's no law that says they can't do this, they can do it. Common sense rarely enters the picture in German legal battles
Legality is a matter of enforcement, not of legislation