Is this assembly legal?
The answer depends on your definition of "legal". In the strictest sense, it means "can be used in official LEGO sets", and in this case, this is definitely not legal, as the axle is not designed to bend that way, unlike the many various hinge and joint pieces.

On the other hand, "legal" might mean "does not cause damage to the pieces", and in this sense it is a borderline case, as you can see the end of the axle retaining its slightly bent shape, but it's nothing that couldn't be fixed with a little more force applied in the correct place and direction.

Whereas on the far end of the legality spectrum, the status of any technique or piece is subject of individual opinion or decision. You are certainly free to employ any combination of parts, use 3rd party parts, paint, glue or cut pieces to your heart's content and shouldn't fear any reprisal from the LEGO Police. Collections curated by others, events or competitions might (and often do) apply a restriction on at least a subset of these, so if you are not in the position to judge the legality, it's best to directly ask those who are.

EDIT based on Michael's comment:

Another criterion in the definition of legality is often "can be easily taken apart by a child", which this design is clearly not.