First, sorry if I’m splitting hairs here but we are talking about diminished 7th chords here and not diminished triads. I mention that because we need the full Ebo7 over D to create the D7b9. It seems like when people (myself included!) say “diminished chord” we are often talking about the 7th variety. I will use the term “diminished chord” as a blanket term covering 7ths here.
As for your two song examples, since we can’t count on lead sheets as accurate representations of a composition I listened to the Fred Astaire version of “A Foggy Day”, which is where the song originated in a 1937 movie. The second chord is a #idim on both A sections.
I was unable to find a soundtrack version of Have You Met Miss Jones (from a musical also in 1937) but early recordings have very different chords in the second bar. Benny Goodman plays a V7/ii. Louis Armstrong plays a ii7-V7/ii and Sinatra plays a #idim so take your pick!
As for your final question, I would say it is the composers choice to make whether to use a diminished chord or a 7b9. That being said, creators of fake books,arrangers and performers often take liberties with compositions for various reasons. As for one being better than the other, that would depend on context and personal opinion to an extent. Are we orchestrating? Arranging? Playing the melody? Improvising over the changes?
Another thing to keep in mind is that diminished chords have several functions. Most commonly it resolves up a half step. Sometimes it resolves to the same root, io-I (i.e. Spring is Here). It can also resolve down a half step. In these other instances the 7b9 chord may not be suitable.
If I am making a harmonic choice, one of my main tests is: Does what I’m doing work well with the melody? If it doesn’t then it goes in the trash. When improvising my note choices for diminished chords tend to be very different than they are for 7b9 chords so that will play a part as well.
As for your title question, I would say a diminished chord voicing will pretty much always work as a substitute for a 7b9 but not necessarily the other way around.