I'm new to blender so please be patient and detailed with your anwsers even this may be a stupid question. So my current situation is that I build a basic rig with rigify in Blender that I want to use in Unreal Engine. All bones in Blender have an orientation, that should be: Y-Axis pointing down, Z-Axis pointing backwards and the X-Axis point to the right. But not every bone in my skeleton or rig has this orientation. The foot and toe bone have a different, kind of weird, orientation, so I thought I could fix this manully, but I can't find any good solution to this. When I select the bone in "Edit or Pose-Mode" and press "R" for rotate or select the rotation-tool, it will pop up and I can screw on it but nothing will happen. Maybe the screenshot will give you an better example what I want to achieve
This isn't so hard to do en masse, provided you don't need to preserve bone lengths; and there's no reason you'd need to preserve bone lengths, because anything that would get broken by changes in bone length is going to be broken by these changes anyways. (In particular, rigify is going to get broken. You have that as a tag, but you haven't specified that you want to do this on a rigify rig.)
First, make sure that you have no bones that are "connected", which is an official Blender property for bones set when bones are parented. You can see if a bone is connected on properties/bone/relations/connected in Edit mode. Select all and alt-p-> disconnect bone to remove that property from all bones.
Once we do that, it's relatively easy to get the orientation you want. Set pivot point to individual origins, orientation to global, then s shift z to scale the tail of all bones to the same XY location as their heads.
This leaves some bones' Y axes pointing upwards rather than downwards; not sure if that's a problem for you. These bones can all be selected and then scaled by -1.
Finally, to set the X + Z axis, enter a rear orthogonal view (should be ctrl numpad 1), then use a recalculate roll operation, using the "view axis" for the roll recalculation.
This will break nearly any rig that is using constraints or animation built for different local axes-- but there's nothing specific about this technique regarding that, that will be true for this entire question. Just feel like I have to emphasize that in case anyone was unaware.