Add attributes like id to block level elements in CKEditor?
If you just need to add ID to a link you can use the D8 Editor Advanced link module https://www.drupal.org/project/editor_advanced_link

It basically allows you to put attributes on anchor tags without touching the source code.