Yes. Yes, they did all those things.
The Beatles set a bar for rockstar-level debauchery which was so high that later musicians such as Keith Moon and John Bonham had to act in ways that were actually criminal in order to top it.
You can read about their groupie-related misbehaviour in books such as Michael Braun’s Love Me, Do! and Larry Kane’s Ticket to Ride. Let’s just say that I’m awaiting the second volume of Mark Lewisohn’s giant Beatles biography with interest: I am 99% certain that Brian Epstein settled at least a few paternity cases out of court. As McCartney once joked ‘Should have been called “Can Buy Me Love”, actually.’
Can we be certain that every last girl that they slept with was 100% legal? I don’t believe that we can, although I suspect we may never know. As Stephen White notes in his answer, the Beatles were such a draw that just being in their entourage made a person a potential groupie magnet. Anyone who’d thought of blowing the whistle was likely to have been complicit in all the goings on.
Hard drugs? They all drank like fish in their early years, room temperature Scotch and Coke being their preferred drink (alcohol and caffeine, y’see), and they gobbled amphetamines by the handful to get them through their exceptionally punishing gigging schedule. Other bands took drugs to make life offstage more interesting: the Beatles took amphetamines in the very early 60s in order to make it through each day. Later on, when they’d acquired stamina, the amphetamines were dropped but the Scotch and Coke remained.
Later they discovered cannabis in a big way. Lennon’s indulgence in cannabis is one of the reasons why between 1964 and 1965, he entered what he called his ‘Fat Elvis’ period:
1963 John: handsome devil.
1965 John: snack much?
Then there was LSD. Lennon, as always, plunged into it, and it has to be said that with all that tripping, he may have occasionally forgotten to eat:
1967 John: he’s seen things we people wouldn’t believe.
Of the four of them, Lennon and McCartney are the only ones that I know tried heroin. McCartney found it did nothing for him but Lennon got seriously hooked, along with Yoko Ono. He wrote one of his more memorable songs while on it (‘Because’), and one of his most heartfelt about the effort of coming off it (‘Cold Turkey’).
Yes, the Beatles indulged in pretty much every debauch available to heterosexual young rock stars back in the day.