How can I stop Ubuntu 18 from moving the active window in a group of windows on the sidebar (e.g. all open chrome windows or all open terminal windows) to the top of the list of those windows (the list that get's displayed when you hover over that group?
By upgrading to later Ubuntu versions. In Ubuntu 19.10, the previews behave as they should: the order is static rather than according to most recently used as in Ubuntu 18.04, so each time you click on the grouped icon, the same window stays on the same place.
Alternatively, you could remove the Ubuntu Dock, then install a more recent version of the Dash To Dock extension from the Gnome Shell extensions website. Ubuntu Dock is based on Dash to Dock, so the experience will be very similar. This, however, is not supported by the Ubuntu developers, so you venture on your own.