Gamma-ray bursts (GRBs) are the most luminous sources of electromagnetic radiation in the Universe, many of whose fundamental aspects are still mysterious. Aiming to clarify their physical origin by detecting them in very-high-energy (VHE; >0.1 TeV) gamma rays, the MAGIC telescopes have been conducting fast, automatic follow-up of GRBs as a key observation program. GRB 160821B, one of the nearest short GRBs known at z~0.16 with evidence of a coincident kilonova, was followed up, starting from 24 sec after the burst trigger. Despite non-optimal observing conditions, hints of a gamma-ray signal are found above ~500 GeV a few hours after the burst. Assuming that the signal was real, we interpret the multi-wavelength observations of this GRB in terms of standard afterglow models. The potential VHE signal can be consistently explained as synchrotron-self-Compton emission from electrons accelerated in the external forward shock with a plausible set of parameters. We also discuss the expectations when such afterglow emission is observed at large angles from the GRB jet axis, corresponding to VHE follow-up of gravitational wave alerts for neutron star (NS) mergers. Interesting prospects are found for sufficiently nearby events with current imaging atmospheric Cherenkov telescopes. Future VHE observations of short GRBs as well as GW sources may provide important new insight into the physics of NS mergers and related phenomena.