Per the other answer and your comment - I don't think there's a way to render the line styles within a specific 'Legend' area, and the C4-PlantUML approach, examples here: https://github.com/RicardoNiepel/C4-PlantUML shows how colour can be used instead to good effect.
However, I've used a separate part of the diagram within an unspecific 'Legend' folder to allow a faithful redrawing of the elements that I want to reuse in the diagram, including elements of the diagram alongside the linestyles.
(Click through to see the code)
I use the stereotype and the skinparams to help reduce the complexity of the actual drawing, the main part of the above could be standardised and included as a link (per the C4-PlantUML approach again) to simplify it even further; it allows for simple changes to the colour and style - there's a small possible bug that I'm going to raise where the linestyle, e.g. dashed or solid doesn't seem to be able to be changed after the usage of the '--' or '..' used to create it in the diagram, but it's a small thing.