All every boy wants is a girl to fight together against dragons.
Yes, this sentence is grammatically correct. The problem is that the word together is placed in an ambiguous place.
You could read it to mean that the boy and the girl need to work together against the dragon, or that the boy needs to fight against both the girl and the dragon. It leans towards the first meaning, but the placement of the word together is awkward. What I could suggest is something like this:
- All every boy wants is a girl with whom he can fight against dragons.
- All every boy wants to fight against dragons with a girl.
For both of these examples, it is much clearer that the priority is the boy and girl working together on the task.