I think if writers could tell for sure, then slush piles would be a lot smaller and wouldn't be full of completely unpublishable stuff and stuff with potential, but that doesn't quite work. That isn't to say that your judgement doesn't improve the more you work at it, as long as you are paying attention to what people who've read your work are saying (even if that's a publisher or agent simply saying "No.")