While I cannot pinpoint a specific show that sells tickets online to foreigners, I would like to give you a bit of background about what issues there are to join such shows in general. I hope this will give you a perspective and some pointers for what to look for specifically.

Participation

There are often foreigners participating in Japanese TV shows. One thing also to be considered is that participants in many Japanese TV shows are comedians or otherwise media-related people. If you switch on the TV, the majority of the shows that you will see are run like that. So the number of shows that would allow "random" people to participate is relatively small compared to western media.

On top of that, most shows on Japanese TV can be categorized in these classes:

Music shows

Variety shows. Those are built around people who contribute actual content, be it from their own expertise or (semi-) celebrities who present pre-prepared content. Topics mostly cover fashion/food and odd/interesting stuff from Japan and around the world.

Comedy shows with comedians and special guests, often combining the two above

Game shows with random participants (the most famous abroad being Takeshi's castle)

The issue is that in most shows there is a lot of talking and without speaking Japanese it would be quite difficult to participate in any meaningful way.

For foreign participants, there are generally two types:

Celebrities who do not speak Japanese but are there only because they are famous in Japan. I guess they are paid to be there, and I think we can skip this here.

Foreigners who do something special, and in most cases speak Japanese VERY well. I am quite sure that they are booked by Japanese PR companies or are there to contribute to the content of the show. Not speaking Japanese and not having anything entertainmentwise to contribute to the show would be quite a big issue if you want to participate.

So as a participant, I would say chances are quite small. You might have higher chances if you go out of Tokyo and try with smaller TV stations in regions like Hokkaido or even Okinawa, but if you specifically want to do so in Tokyo, it will be much harder, simply because they need high quality content for entertainment rather than foreigners who "just happened to pass by" but cannot actively contribute content.

Audience

First of all, I have never seen foreigners in an audience on Japanese TV. On top of that, there is rarely a chance for random people to be part of it. Exceptions are large-stage music programs where tickets are sold like concert tickets. This is because the size of the audience in Japanese shows is often quite small and comes across as hand-picked. So often, the type of audience is highly controlled by the TV station. If you do not fit the target demographic, you will not be let in. The result of this is that you will just not have the possibility of finding a link on the TV station website that says "Tickets for our live shows here!". (The same is true for most US stations) You have to find a show that you like, that you will fit in as a target audience and then try to find a ticket for it. In the US, normally you can however apply or line up for a ticket directly. In Japan, it's often a two-step process: You have to first apply via postcard for a membership at the TV station's club (such as at NHK), and THEN apply for a ticket through the membership account. There will be a lottery among all participants to get tickets. All in Japanese of course, and you will need an address in Japan to register.

So as a summary, if you are going to Japan at a specific date and try to get tickets for something recorded in Tokyo beforehand without speaking Japanese, it will be very difficult unless someone here can point you to a specific show that would fit these requirements and help you with the whole application process, too.

Additional Issues

An additional note about the challenges with being a foreigner: Even if you speak Japanese fluently, bear in mind that any coordination that needs to be done with you is a big challenge, which is of course the biggest issue if you want to participate in a show rather than just being in the audience. In a company (such as a TV company) which is not used to frequently dealing with foreigners, the staff will not even be able to call you unless you have a Japanese phone number because international calls are normally blocked on their phones. Internet sites often require addresses, local phone numbers etc to register. If you do not speak Japanese, finding someone who speaks English is a huge challenge. Therefore, since you are trying to do something that normally only locals would do, you might have the biggest chances of succeeding if you have a Japanese local intermediary like a travel agent or a friend there to help you.

I would also exclude Talent shows and the like (see comments below). The coordination with you over phone, in Japanese and the fact that you would have to go to auditions and (assuming you do not get kicked out in the first show) subsequent shows would fall out of reach because of the reasons above. I would also strongly assume that those shows require interviews and are highly geared towards local Japanese talents instead of tourists/foreigners. I know of foreigners competing in local tournaments, but I am quite certain that the Tokyo marathon has different requirements in that sense than "Japan's got talent".