Mew, even if caught, won't count as a Dex entry in Gen 1. Yeah, he'll be there, but if you speak to the Game Developer, or whatever his name is, in Celadon and you have 150 Pokemon, with Mew as one of them, he'll still treat it as if the Dex is incomplete. Mew was through in for God knows what reason, but all we know is that it's there. Maybe Mew was added simply as an extra little Easter Egg? Maybe the glitch to get it involving the Youngster and Gambler was all pre-programmed so that one day anyone with a Pokemon R/B/G/Y would be able to get their hands on Mew, we don't know.
Er... Mew DOES have a Dex entry in Gen 1.
Though it won't count towards the 150 Pokemon Diploma thing.
Which makes sense since in the Japanese version of the game meant that if you showed the guy 150 Pokemon, he was supposed to give you Mew as a reward.
Mew was/is an event-only Pokemon in the third generation and fourth generation.
It was unavailable in the second generation unless you cheat it in or trade it from Gen 1 after cheating/glitching to get it there.
Capturing Mew using the Mew Glitch is simple enough to do and won't mess up your game.
Capturing it with gameshark/action replay won't mess up your game either.
That said...
Mew was a VERY little known secret back when the original japanese red and green came out. Not even Nintendo knew that Shigeki Morimoto had programmed it into the game.
It should be noted that Mew was available as an event-only Pokemon in Generation 1.
So that's the only legal way to get it.
So for those saying that there was no way to get it legally, you are incorrect.
It WAS an event that was given away to red/blue/green/yellow players at a Nintendo Event and was given to players by direct trade using the old link cables.
So as of now, there is no legal way to obtain it in the first, second and third generations as events for those generations are over.
It was available for the fourth generation through promotional giveaways such as the Tenth Anniversary (of Gold and Silver) Mew given away in Japan and over Wi-Fi back in November (11th to 23rd) 2009.
The only currently available legal way left to obtain Mew now is to trade it over after you receive it in a trade with Hayley from My Pokemon Ranch after transferring 999 Pokemon to My Pokemon Ranch.
Or if you use Pokesav to load the wondercard of an event-only Mew into your game.
This will come across as perfectly legal and can be used in competitive battling (if it's within the rules to use Pokemon like Mew) since the game will just recognise Mew as having being received in the event and nothing else.
So yeah, to answer your question...
The only way you could receive Mew in Generation 1 was in a Nintendo event.