Paragraphs preprocess
A paragraph is a content entity with fields, that is viewed within its parent entity. It uses exactly the same mechanism to be displays as nodes, comments, and so on. Through field formatters. 

You can implement your own field formatter plugin that transforms your (link?) field in any way you want. You receive field items and have to return a render array. That's the only restriction.

Like all plugins, it's a class with an annotation, in a specific namespace/folder. The default formatter for link fields is LinkFormatter. The most important method is viewElements().