Yes, those sites are legitimate. According to the IRS FAQ, Pay.gov interfaces with Amazon and PayPal, and the ETCL user fee can be paid using an Amazon account or a PayPal account. This indicates that when you use Amazon or PayPal to pay for the ETCL, you are being redirected to Pay.gov, which is a legitimate and authorized platform for such transactions.
Sources:
Publication 3598 (11/2023)
Publication 3151-A (9/2017)
Publication 1380
Publication 4453