Yes, you can.
However, it's not documented (as far as I know), so it will require some digging.
Conditions for the segment builder use the analytic index (either Lucene or SOLR) to filter the data.
So a requirement of a custom condition is that the data you are using to filter, exists in the index.
Here is a piece of example code that let's you create a segment with one contact that has a specific ID:
using System;
using System.Linq.Expressions;
using Sitecore.Analytics.Rules.SegmentBuilder;
using Sitecore.ContentSearch.Analytics.Models;
using Sitecore.ContentSearch.Rules.Conditions;
public class XDbContactIdCondition<T> : TypedQueryableStringOperatorCondition<T, IndexedContact>
where T : VisitorRuleContext<IndexedContact>
{
public XDbContactIdCondition()
{
this.OperatorId = "{10537C58-1684-4CAB-B4C0-40C10907CE31}"; // The ID of the "string operator is equal to" item
}
protected override Expression<Func<IndexedContact, bool>> GetResultPredicate(T ruleContext)
{
return this.GetCompareExpression((IndexedContact c) => c["_uniqueid"], string.Concat("contact|", this.Value));
}
}
This is just one simple example and it if you need to find out more, I recommend you take a decompiler (dotPeek, Reflector, etc.) and dive into the Sitecore binaries looking for segmentation code belonging to the List Manager. That's how I figured this out a while back.