Question: Given a diatonic chord in a scale, what are the rules to find out which tensions among 9, 11#, 13, I can use?

Answer: 
And don't forget the 7th!

Well, you probably don't want to clash too closely with the melody. And you should consider the harmonic density - a b9#11 chord can sound a bit odd when surrounded with plain triads.

Above all, try not to see chords as seperate entities, but as a combination of melodic lines.
As a rule of thumb, an interval of a b9 between any two chord notes usually is considered too dissonant. 

For major chords, available tensions are 9, #11 or 13.
For minor chords, available tensions are 9, 11 or 13.
For dominant chords, available tensions are any 9, #11, b13 or 13.

As always, music theory can be considered recommendations. Needless to say, if b9's really rock your boat then you will not get arrested for using them.