As far as I know you cannot set the allegiance of an individual unit without also changing the allegiance of all units of that player/neutral. However, if your map uses less than 12 players, you could use player11 or player12 for the dragon. You may need to trigger some of it's AI if you want it to behave like a neutral creep. If you intend to do this for lots of different units on a map then this solution may not work unless you have enough free player slots for each different unit.