In legacy, it is possible to add custom ids to links. And legacy won't complain if you use the same ids multiple times even though that is a not allowed in html. eZ Platform will complain though, so such id's must be changed and made unique
According to the xsl, embed and embed-inline might also have such custom ids but it is not possible to add such using ezoe ( it is possible to add such ids using simplified-xml though, but ezoe will remove the ids again if enabled ).
Original bug report : https://github.com/ezsystems/ezplatform-xmltext-fieldtype/issues/27