Is the Pegasus email real?
No: an email that claims "Pegasus" was installed on your phone and asks for payment, usually in cryptocurrency, is a mass extortion scam, not a real attack.
The sender has your email address and sometimes an old password from a public data leak, which they quote to sound convincing. Do not pay, do not reply and do not open links. Change any password they quote, everywhere you used it.
A real Apple threat notification never asks for money, a link click, an app install or a code, and it also appears at the top of the page when you sign in at account.apple.com. To see where your phone's connections really go, Inspectir lists every company it reaches.