Oh, you mean it happens when using an actual web browser, not when using the embedded browser in MC itself. I've seen this happen on Windows on a lower performing system when Windows Defender's memory integrity feature was enabled. This uses virtualization technology which can interfere with audio playback in MC and cause stutter issues on lower powered systems for example. You can try increasing the buffer for the audio output used and see if that makes a difference, but the case I experienced years ago I ended up having to disable memory integrity in Windows Defender's settings in order to resolve it.
If memory integrity isn't enabled, then it kinda sounds like spikes in DPC latency. In that case try using an app like LatencyMon and see if DPC latency spikes are happening. Like whoareyou mentioned it's probably a good idea to list system specs.