Yes, you can.
Even tho you became allies with Blue Djinns, for an example, you can still kill Blue Djinns, otherwise it would be impossible to complete the bestiaries after having the quest done!
The quest only defines which doors/NPC you will be able to go through.