Both proposals have undergone changes since they were proposed, and now each exists in multiple versions. The Sapir-Whorf hypothesis was originally understood to be a proposal that mental categories which are involved in cognitive tasks other than language use could be arbitrarily shaped by the language practices of a given community. Nobody who is interested in the issue at a professional level believes this anymore. Neo-Whorfianism, on the other hand, is a modern research program whose proponents believe that while there are strong biological constraints on cognition, there are some areas of cognition where a person's native language influences the way they conceptualize things. What are called Nativists do not believe that language can have any such influence: they believe instead that differences in thought processes can be explained in terms of factors such as a person's exposure to literacy, or the type of geographic locale, amongst other factors. To see an example of this kind of debate in the area of spatial cognition, consider the Neo-Whorfian study by Pederson et al (1998), and a similar Nativist-oriented study by Li & Gleitman (2002).
Nativists tend to subscribe to some form of the Universal Grammar hypothesis, while Neo-Whorfians tend not to. While all or nearly all linguists agree that there is something special about human brains that allows them to use langauge (cf. comments on Chomsky's "Rocks and Kittens" argument for UG), actual UG proponents believe that there are special cognitive abilities which have evolved in humans which are only used for language processing. This may lead (though logically it doesn't have to) to the belief that language processing may be "segregated" from other cognitive functions, and so there is no possibly that knowledge about language can interfere with other cognitive abilities. This is probably why most Nativists tend to be UG proponents. If one believes instead that language ability is tied to other types of cognitive abilities outside of the domain of language, then it is not so hard to see how language and non-language thinking patterns might influence each other at least a little bit.
Pederson, E., Danziger, E., Wilkins, D. P., Levinson, S. C., Kita, S., & Senft, G. (1998).
Semantic typology and spatial conceptualization.Language 74(3), 557-589.
Li, P., & Gleitman, L. 2002. Turning the tables: Language and spatial
reasoning. Cognition 83: 265-294.