If you want to generate a single locale, this should theoretically suffice:
echo "locales locales/locales_to_be_generated multiselect en_HK.UTF-8 UTF-8" | debconf-set-selections
dpkg-reconfigure --frontend noninteractive locales
In practice though, dpkg-reconfigure will fail to generate the locale under Ubuntu 20.04. To workaround, you need an additional command:
echo "locales locales/locales_to_be_generated multiselect en_HK.UTF-8 UTF-8" | debconf-set-selections
rm /etc/locale.gen
dpkg-reconfigure --frontend noninteractive locales