Can a bent hub damage my fork? I've recently noticed that my front hub is bent, or at least the parts that connect to the fork (any name for this?). It's not a huge bent, but it's clearly visible with your eyes.

It fits the fork without any problem, but I'm wondering if I should keep these, or if that may damage my fork somehow (as a fork is probably more expensive than hubs...)

See the highlighted part in the picture? That's the bent part. It seems to be bent through the whole length of the hub, not only the external part. Actually, when I rotate the wheel, I can see this part moving from side to side.
The part you've circled is called the axle, even if it is not solid, and if it's bent you need to replace the axle, or the hub, or the whole wheel, whatever is cheapest. It can likely cause minor damage to your fork, but more importantly, if it's bent then it can fail- potentially in a catastrophic manner. Get it fixed, cheap insurance.