Both players returned from maternity leave a year ago at the desert tournament. Since then, Williams has reached two Grand Slam finals and returned to the world's top 10.
"It's been an arduous road," Williams said. "I think we both really appreciate both of our efforts to do the best that we can do."
Azarenka is still seeking to restore order in her personal life, having been involved in a legal tussle over her young son.
Williams needed just over two hours to close out the match in which she had four aces and nine double faults. She saved 11 of 15 break points.
Williams and Azarenka were meeting for the first time since their 2016 final at Indian Wells, which Azarenka won.
"As much as she's the toughest opponent I have ever played in my life, she's my favorite person to play against," Azarenka said. "Why I still play is because I enjoy the challenges. If it's easy, if it's boring, I don't want to play."
The two women shared an embrace at the net afterward.
The fourth-seeded American committed 32 unforced errors while Voegele had four aces playing in windy conditions. Voegele improved to 4-1 against the 2017 US Open champion.
Stephens wasn't the only seed to be ousted on the women's side.
No. 14 Daria Kasatkina, a finalist last year, lost to Marketa Vondrousova 6-2, 6-1; No. 19 Caroline Garcia lost to Jennifer Brady 6-3, 3-6, 6-0; No. 27 Su-Wei Hsieh was beaten by Johanna Konta 6-0, 6-2; and No. 29 Mihaela Buzarnescu lost to Daria Gavrilova 6-2, 6-2.
In men's opening-round matches, Steve Johnson beat fellow American Taylor Fritz 6-3, 6-3, and Stan Wawrinka edged Daniel Evans 6-7 (4), 6-3, 6-3. Also advancing were Feliciano Lopez and Hubert Hurkacz.