You could put this on ApplicationController, but honestly I recommend against that. ApplicationController tends to become a big bloated blob over time, accumulating utility functions that are really not related, definitely not SRP. It can get ugly.
What I've done to keep things DRY is to create a parent controller that related controllers can inherit from. Put your before_filter on that and have the related category-using controllers inherit from it.
Maybe:
class MainPagesController < ApplicationController
before_filter :load_categories
private
def load_categories
@categories = Category.all
end
end
class SomeController < MainPagesController
# etc.
end
If your app is small-ish, won't grow significantly over time, and you truly do load @categories on almost all of your pages, then putting it on ApplicationController might make sense. But I tend to err on the side of over-DRYing my code. Very small classes that have siloed functionality is never a bad thing.