Are there fenders designed specifically for bikes with racks? I have a bike with a rear rack and want to buy a rear fender. Is there any fender that is specifically designed to be used in a combination with a bike rack?
Fenders don't fall into an "ok with racks" or "not ok with racks" category. Generally speaking, most traditional fender designs will work on bikes with racks attached. There may be certain combinations of fenders and racks that are problematic, but those are the exception.

An example of a problem would be a bike whose rear rack is very close to the top of the rear wheel - it would be hard to fit a fender in there, but that's a specific problem which requires a specific solution.

That said, when putting a lot of accessories on a bike, we should expect to be bending and cutting and filing as we go. We should not expect a front/rear set of fenders and racks to be a perfect fit on a frame out of the box unless each of those parts were specifically designed to be a fit with each other.