In fact it is recommended practice in GeoServer to use relative URLs for icons stored in the datadir (usually in the styles/ directory). However, GeoServer reads and re-encodes SLDs uploaded through the REST API and relative URLs don't survive the transformation. We'd need to fix that aspect of GeoServer before we could rely on being able to use relative URLs in the icon declarations. Probably, we'd want to be able to upload (and query?) images through the REST API as well.
In fact it is recommended practice in GeoServer to use relative URLs for icons stored in the datadir (usually in the styles/ directory). However, GeoServer reads and re-encodes SLDs uploaded through the REST API and relative URLs don't survive the transformation. We'd need to fix that aspect of GeoServer before we could rely on being able to use relative URLs in the icon declarations. Probably, we'd want to be able to upload (and query?) images through the REST API as well.