Black holes in cosmological spacetimes and alternative theories of gravity