Is a sacrifice ball hit caught in foul territory counted as an at bat?

No. As long as it still acted as a sacrifice fly, the at bat would could like a regular at bat. A sacrifice fly would mean that a runner would have to score as a result of the hit.