While the two terms are often used interchangeably, they are not the same.
A logo is a mark that visually identifies a brand. It can be a graphic image, a typographical representation of a brand name, or a combination of both.
A visual identity is a broader concept that encompasses all the visual elements that make up the look and feel of a brand. It includes the logo, choice of colours (colour palette), font choices, image style, layouts, and others. These support the design and production of other brand items, such as business cards, email signature, or peripherals. All these elements are outlined in a brand style guide.