Yes, it is possible to trademark a slogan or a tagline; however, this might prove difficult since all trademarks must meet the distinctiveness criterion, and a slogan might not be distinctive enough on its own to be granted registration.
Let's look at this in detail. First, a slogan would have to registered as a word mark, a type of trademark that protects only the text, with no visual stylisation. This already removes one option of possibly distinguishing the slogan. With word marks, the mark's distinctiveness has to derive only from the text itself.
Moreover, where brand names can gain distinctiveness by using made-up words (Pepsi), words evocative of a characteristic associated with the brand (Jaguar), initials (IBM) or other strategies, a slogan is typically a sentence or a sentence fragment communicating the brand's proposition to the reader, limiting the creator's options.
To trademark a slogan, it's best to make sure it's not merely descriptive of the goods/services you are offering and that it is memorable enough to be connected to you. A couple of examples of trademarked slogans include KFC's "It's finger-licking good", NIKE's "Just do it", or even McDonald's "I'm loving it" due to its distinctiveness achieved by bending the grammar.