Two-time defending champion Carlos Alcaraz needed to go through five sets against Fabio Fognini at Wimbledon before winning their first-round match.