how could I turn active a bone in ui header? (blender 2.79)
Select active bone in pose mode from UI

Use the draw method to draw UI elements only Cannot set properties of ID elements in draw method (the error arm.bones.active = d_bone ). 

In general, Use operators or property update methods to assign values

To set the active bone in pose mode from the UI, can simply put the "active" property of the armature bones collection into the layout.

Below I've used a UI_Layout.prop_search there may be a template that also does similar.

    def draw(self, context):
        layout = self.layout

        obj = context.object
        arm = obj.data

        row = layout.row()        
        row.prop_search(arm.bones, "active", arm, "bones")