Any process in which a peroxisome is transported to, and/or maintained in, a specific location. A peroxisome is a small membrane-bounded organelle that uses dioxygen (O2) to oxidize organic molecules.