Cycling windows by click on dock program's icon

"Ubuntu Dock" is forked from the extension "Dash to Dock", and accordingly uses it settings. Thus, you can change the behavour of "Ubuntu Dock" by editing the dconf settings of "Dash to dock", using dconf-editor (not installed by default in 18.04) or with the single command:

gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'cycle-windows'

You can list all possible settings:

gsettings range org.gnome.shell.extensions.dash-to-dock click-action 

Reset to the default setting with:

gsettings reset org.gnome.shell.extensions.dash-to-dock click-action