Do you mean the home screen icon or the favicon (small icon shown in the browser tab)? Favicons are more or less a standard, while home screen icons are dependent on the specific OS:
- On modern Android phones, you should be able to use the App Manifest
- On Apple iOS you need to add
<link rel="apple-touch-icon" sizes="..." href="..." >
, and unfortunately you need one of this for each icon size
In a progressive app I maintain, I had to produce iOS icons for all these sizes: 48x48, 72x72, 76x76, 96x96, 120x120, 128x128, 144x144, 152x152, 167x167, 180x180, 192x192, 300x300, 512x512, 1024x1024. As absurd as it sounds, I think that is still necessary in order to support all devices.