Pegg oversaw a team of 72 and reported to marketing director Andy McQueen. It is understood Pegg's role will not be replaced.
A Nationwide spokesman said: "I can confirm that Alastair Pegg has left, but we do not go into individual circumstances surrounding employees."
Pegg was made head of brands and marketing at Nationwide in March 2011, having previously been head of brand marketing since January 2010.
He has been instrumental in the brand’s "on your side" marketing strategy that features a pop-up storybook creative theme and emphasises the banks’ mutual status, and he has also helped oversee the brand's embracing of social media.
Nationwide was one of a number of brands to hit the headlines last month for pulling its advertising from Facebook, following a campaign urging consumers to target advertisers whose ads appeared next to content promoting domestic violence.
The brand took to Twitter to apologise to customers and pledged to suspend its advertising.
Prior to joining Nationwide, Pegg held the positions of head of brand marketing at Vodafone, marketing director at RAC and head of customer marketing at Virgin Money.