The Daily Show with John Stewart is filmed in New York City. How can someone be in the audience of the show?
This cannot be answered in absolute terms since the availability of tickets is not always given. Currently, for example, nobody can get tickets. There is, to my knowledge, no limitations who can get tickets to these shows, as long as they are available at all.
As Ilya noted, this page described in late 2012 how you can get standby-tickets by waiting outside of the studio.