How can I use Html::getUniqueID?
The purpose of the clean_id filter isn't providing a unique ID, but removing from the string used as HTML ID the characters that aren't allowed. Basing on 6.2 SGML basic types HTML IDs can only contain letters, digits, hyphens, underscores, and colons.
Html::getUniqueId() itself uses Html::getId().
// If this is an Ajax request, then content returned by this page request
// will be merged with content already on the base page. The HTML IDs must
// be unique for the fully merged content. Therefore use unique IDs.
if (static::$isAjax) {
  return static::getId($id) . '--' . Crypt::randomBytesBase64(8);
}

// @todo Remove all that code once we switch over to random IDs only,
// see https://www.drupal.org/node/1090592.
if (!isset(static::$seenIdsInit)) {
  static::$seenIdsInit = [];
}
if (!isset(static::$seenIds)) {
  static::$seenIds = static::$seenIdsInit;
}
$id = static::getId($id);

The documentation page for Html::getId() says it should be used only when the ID doesn't need to be unique.
For the cases where the ID needs to be unique, Drupal core modules set a variable passed to the template file, which is what's done in template_preprocess_pager(), template_preprocess_block(), or template_preprocess_views_view_table(), for example.
variables['heading_id'] = Html::getUniqueId('pagination-heading');

// Create a valid HTML ID and make sure it is unique.
if (!empty($variables['elements']['#id'])) {
  $variables['attributes']['id'] = Html::getUniqueId('block-' . $variables['elements']['#id']);
}

// Improves accessibility of complex tables.
$variables['header'][$field]['attributes']['id'] = Html::getUniqueId('view-' . $field . '-table-column');

Since Drupal core doesn't have a Twig filter that returns a unique ID, that is the only way to obtain one: Set a variable in a preprocess function used for the template file with the value returned from Html::getUniqueId(), and use that variable where the template file needs a unique ID.