Kerber, who plummeted down the rankings last year after finishing the year before at No. 1, broke Sharapova's serve in the first game of the match and that set the tone for what followed.
Defending champion Roger Federer just picked up where he left off, beating Aljaz Bedene 6-3, 6-4, 6-3 in a night match, his first on Rod Laver Arena since clinching a career-reviving title in previous year.
"It's great to be back", the 30-year-old, who'll take on former No. 1 Angelique Kerber in the third round on Saturday, said.
"I was just trying to go out on the special court for me and play good tennis".
"The second set was tight, the match was close and I had to focus to the very end", said the Swiss 19-time Grand Slam victor, who next plays little-known Hungarian Marton Fucsovics for a place in the quarterfinals.
"She never really lets up", Sharapova said. "I had some incredible memories in Melbourne Park and that comes back every time I step out on the court but I have to be more humble with my expectations this time because I haven't played for six months, but I'm very happy with where my game is". A cracking forehand victor brought the German a triple match point, and she converted on the second as a Sharapova backhand flew wide.
Djokovic beat the Frenchman for the 15th consecutive time - 4-6, 6-3, 6-1, 6-3 in temperatures that reached 40 degrees Celsius (104 Fahrenheit).
World number 48 Sharapova is playing only her second Grand Slam tournament on return from drug ban.
German interest in the men's draw is over after Alexander Zverev failed to match compatriot Kerber's achievement, crashing out in five sets against South Korea's Chung Hyeon, 7-5, 6-7 (3-7), 6-2, 3-6, 0-6.
As well, it was Federer's 90th match win at Melbourne Park.
"Obviously for me, it's taking it one match at a time". The Russian superstar, who won her only title on her comeback run in Tianjin a year ago, feels she can produce consistent results in the coming days.
"I'm nearly dead", Halep said of the match which equaled Chanda Rubin's win over Arantxa Shanchez Vicario in 1996 - also 48 games - for the Australian Open record in terms of most games.
Six-time Australian Open champion Djokovic continued his comeback from six months out with an injured right elbow, beating No. 21 Albert Ramos-Vinolas 6-2, 6-3, 6-3.
Kerber took the first set in just 29 minutes, displaying her trademark athleticism and forcing Sharapova into a number of erratic shots.
But the German, who lost in the fourth round in Melbourne as the top seed a year ago, was showing a return to her old self when she arrived this week. And that one fourth-round finish was her best thus far in the 27 main-draw Majors she has played in 16 years. "I want to be playing against opponents that are former grand slam champions", Russian Sharapova said.
"It was brutal", Djokovic who wore a compression sleeve and employed a truncated service action, said.
"That was insane", Wozniacki said after winning the last six games in a memorable 3-6, 6-2, 7-5 victory.
Halep earlier looked out for the count against 76th-ranked American Lauren Davis.