I am not sure but I think ggsave can be used only for a ggplot graph and pie is not - it is a function for base R.
For regular plot, you can use grDevices::png() for png graphic devices
png('Sales Percentage Comparison.png', width = 15, height = 10, units = "in")
pie(slices,labels = lbls, col = c("red","green","blue"), main = "Sales Dollars Percentage Distribution", cex=0.8)
dev.off()
I thing this should work; You may have to tweak it though.
EDIT:
I just checked. pie is not like a ggplot function, it does not return an object. So you can use ggsave but by directly providing the plot call.
temp_file <- tempfile(fileext = ".png")
ggplot2::ggsave(
filename = temp_file,
plot = pie(rep(1, 24), col = rainbow(24), radius = 0.9),
width = 15,
height = 10,
dpi = 300
)
img <- magick::image_read(temp_file)
magick::image_scale(img, 'x300')
unlink(temp_file)

Created on 2018-06-30 by the reprex package (v0.2.0).