All the custom fields I've used are simple data tags. If you're asking whether it is possible to iterate over all the custom fields defined for a track or album, I see no way to do that.
However, most of what I know about writing templates I learned by looking at how the default template works.