But of course you can. Here’s what Garner’s Modern American Usage has to say on the topic: “It is a gross canard that beginning a sentence with but is stylistically slipshod. In fact, doing so is highly desirable in any number of contexts, as many stylebooks have said (many correctly pointing out that but is more effective than however at the beginning of a sentence).”
The Chicago Manual of Style agrees: “There is widespread belief—one with no historical or grammatical foundation—that it is an error to begin a sentence with a conjunction such as and, but or so. In fact, a substantial percentage (often as many as 10 percent) of the sentences in first-rate writing begin with conjunctions. It has been so for centuries, and even the most conservative grammarians have followed this practice.”
For example: Everyone decided to vote against Bob’s idea. But Pat disagreed.
So there you have it. If beginning a sentence with but “works” or “sounds right” for the sentence you are writing, then do it.