Hello,
I agree, this appears to be a bug. Every template should take care to properly escape all input that can originate from users and isn't already being sanitized in another component earlier in the chain of processing.
Please report this as a JIRA.
You can only remove the defective entry from the feed via direct database manipulation, since as far as I know, there is no API for you to use to query and delete individual entries. You can use the <id> as a reference to find the relevant entry, but I am not sure wether this is post_id or feed_id in the Alfresco alf_activity_feed table…
Otherwise, after 30 days, you should no longer have any problems because entries are deleted after that time by default.
Regards
Axel