It is perfectly correct usage, however not the most common use of but.
Per the Free Dictionary, To the contrary: to the opposite effect from what has been stated or what is expected; contrary to expectations.
But: contrary to expectation; yet.
In your example, let's reword.
Most people think Pat will fail, (but/to the contrary) who knows? I think that Pat may actually succeed.
Substituting and shortening:
Most people think Pat will fail, but who knows? I think that Pat may actually succeed.
leaving
But who knows that Pat may succeed?
Not quite right (though acceptable depending on the previous sentence). Better:
Who knows but that Pat may succeed?
All the between steps are understood by fluent English speakers. Again, this is not the most common construction using but meaning to the contrary. A much more common one is fully worded out, as in the first example.