You are talking about correcting for deviation (the error imparted to the compass by localized ferrous and/or magnetic objects, …. Like within 5 feet or so.) This is nothing to do with compass variation which has to do the changes and anomalies in the earth’s magnetic field, and magnetic north being different than true north.
The process of correcting for deviation is known as "boxing the compass" . If you have corrected the compass on one boat, that effort and correction will be meaningless and worthless if you move the compass to another boat. Things that affect a compass and create error are speakers nearby (biggest issue due to the magnets in them), steel objects nearby, radios, even things as harmless seeming as soup cans stored in a cupboard in the cabin just below the compass. ANYTHING magnetic, steel, or containing magnets near a compass will cause deviation.
Normally you correct the compass as closely as is reasonable and then create a deviation table so that you know how many degrees deviation you must correct for from your compass reading to get to the actual magnetic heading.
When boxing the compass you typically take a separate compass aboard the boat that can be temporarily located somewhere where it will not be affected by any steel, magnetic objects, or magnets, and use that compass to compare to and correct to and create a deviation table from. Correcting a compass is a whole topic that careers have been made of.
Declination is the same as variation, and you very much need to correct for that when navigating and traveling distances. Traditional paper navigation charts always contain two superimposed compass roses so that you can see the local variation.