It is cheapening the fight
Even if the game allows it RAW, as Mr. Ouimet said:
Adventurers can pay nonplayer characters to assist them or act on
their behalf in a variety of circumstances. Most such hirelings have
fairly ordinary skills, while others are masters of a craft or art,
and a few are experts with specialized adventuring skills.
Moreover, according to the SRD:
The amount shown is the typical daily wage for mercenary warriors, masons, craftsmen, cooks, scribes, teamsters, and other trained hirelings. This value represents a minimum wage; many such hirelings require significantly higher pay. Typical equipment for a guard or mercenary warrior is studded leather armor and a club, shortsword, or shortspear. Most guards are off-duty soldiers or city watchmen, though some are unskilled laborers with a talent for fighting.
And this value is shown:
Hireling, trained 3 sp / day
Attacking a dragon, for these hirelings, amounts to suicide.
With respect for the contrary opinion, attacking a dragon is a heroic act that can only be done with PC classes or by some high power creature.
I would not allow my players to do it.
It would set an unfortunate precedent.
They should do some side questing, buy specialized equipment and gather information instead of just teaming up with another PC class NPC group.
Moreover, if the NPC dies, your PCs will probably be able to take their equipment, and get even more value out of the fight. IF you play with RAW, you will have to follow the Damaging Objects rules of the SRD, in order to know if they are destroyed by the fight. If you do it this fight and not every fight, it will seem inconsistent rule handling.