The types of B-movies you're talking about are profitable before they're even made. It's an entirely different type of film production. The producers do something called "pre-selling."
What happens is a producer will do one of two things:
- They will buy/option an extreme genre script that has some sort of appeal based on the absurdity. Something like "Werewolf Cops" or "Nazi Zombies" or "Santa's Revenge."
or
2) They'll buy a relatively standard action script and attach an internationally well known American actor who either work cheaply because they take so many projects with little down time (Commonly people like Nic Cage, John Travolta, Keanu Reeves, Jason Statham), cast a well known American actor in a supporting role they can film very quickly (so they only have to pay them for a week or two) but give them top billing so they look the main character (often someone like Bruce Willis or Samuel L. Jackson), or they cast a non-actor celebrity or "past their prime" celebrity who will take a lead role for low pay (like Tara Reid, David Hasselhoff, Paris Hilton).
Then, they sell the distribution rights
before they make the movie to non-American regions. For example, the producer will make a deal with a distributor in Belgium, Japan, and India. They'll sell one distributor in each country the exclusive rights to release the "newest Bruce Willis/Nic Cage movie" or "the most extreme Hollywood zombie movie yet!" or "Nick Cannon's Hollywood movie debut!" The producer will allow these foreign markets to release the movie a month or two before it's released anywhere on the internet, DVD, or in the US.
The "exclusive" rights to a Hollywood/American movie, especially with a known celebrity, premiering in their country before the US is enough to get a little buzz and generate some revenue in foreign markets that either don't have a significant film industry of their own or are big consumers of American media. Even if the movie isn't very good, especially by the standards of American audiences.
Another little trick to incentivize foreign sales are things like agreeing to shoot a couple major scenes in the foreign buyer's country. If the country isn't used to having their landmarks in American movies, it may create some local excitement that boosts the local box office. Or the country may just be motivated to make a deal like that in the hopes that more films may shoot there, which could be good for their economy.
So, let's say a producer manages to sell the distribution rights to 5 different foreign markets for a total of $9 million between them. The producer then sets the film's budget at something like $5-6 million. They use the pre-sale profits to fund the movie, and are already up $3 million dollars in profits.
Then they'll make deals to sell mass quantities of DVDs to stuff retail bargain bins and rental kiosks, throw the movie up on iTunes, or potentially even strike a deal with On Demand, Amazon Prime, Netflix, etc. They'll usually spend next to nothing on advertising, and bank on people taking the chance on a random movie because they like Pierce Brosnan or recognize Donnie Wahlberg, or because watching Bigfoot terrorize a ski lodge seems like it'll be hilarious to watch while stoned, or because they'll watch any haunted house movie, or they won't be able to believe someone made a movie about zombie ninjas where Dolph Lundgren plays the president and how do you NOT watch that?
And it doesn't matter, because the movie is already profitable, and the extra half a million to five million the movie may be worth in the US or online is just icing on the cake. It can snowball, because the company can now boast "the last 15 movies we made were profitable" and garner more interest from distributors or justify more money for exclusive/advanced rights.
A production company may knock out 5 or 10 of these movies in a year, and every once in a while a clip may go viral on Reddit, or get mocked on Conan O'Brien, or get some cult following status, and all of a sudden they have a little cash cow. In some cases, it may even boost sales enough that they can sell/license merchandise, spawn a little franchise, or even give them a track record/clout to get more money in future distribution deals.
These unknown studios may have a catalogue of movies that no one has heard of, have only been screened in a few overseas countries, or that are even mocked for how terrible they are, and yet they could be pulling in 8 to 9 figures of profit every year. Almost always, these producers are 100% aware that their movies aren't very good or are pure dumb entertainment. But there are a couple of cases where these companies have a few extra dollars after a little while and start to take chances on slightly better/higher budget material, managing to "break through" to the American market with a well-reviewed or well-liked film that puts the little studio on the map and legitimizes them.
I'll also add that not all movies you see in those settings are made this way. Sometimes the money is raised independently and they shoot the film independently, but then no one buys the movie and the producers awful deals to make even a small amount of money back and end up with a small DVD release. Or a larger studio/production company finds that their movie is getting horrific early reviews so they cut their losses and dump the movie with a quiet digital/DVD release rather than wasting more on marketing.