To answer the queries directly:
Are all of these different styles of the same characters used in China
as well, or are they specific to Japan? Is it important for me to
learn about them (i.e. learn both shapes of 令 or 直)? Note that
Traditional Chinese fonts (like MingLiu) will often have different
versions from Simplified Chinese ones for the same Unicode code point
(though not as extremely different as the Japanese one).
The difference between the shapes is due to a mixture between three main sources:
- Variant Chinese characters;
- Different handwriting habits between the different regions;
- Different choices and considerations when standardising the print shapes.
Pending on the specific character that looks different, it could be due to one region not using the character at all, one region having different print vs. handwriting shapes, or one region totally merging the print and handwriting shape.
What other common characters are there which may look significantly
different in different-language fonts?
Many, and the shape differences are of varying severity. Two very common character components that trips people up is (1)「⺼・肉」which sometimes looks identical to「月」, and (2)「辶・⻍・⻌・辵」which is a complete mess in the Japanese standard.
Should I just think of these differences as similar to the common
stylistic differences in the small Roman letter 'a' and 'g', like in
the image below?
Yes and no. Some of the shape differences are indeed stylistic differences, such as「令」. Indeed, the left hand "g" and the right hand "g" are exactly analogous to the Chinese vs. Japanese printed form of「令」. The "g" on the left hand side is the shape always seen in handwriting, similar to the Chinese shape of「令」always seen in the handwritten form in both China and Japan. The Japanese printed form of「令」is traditionally the shape always seen in print form, in both China and Japan. China decided to change the print form to the handwritten form later.
However, not all the shape differences are stylistic.
The shape discrepancies are a bit different from the Western typographic tradition. In particular, there is nothing similar in scale as the Han unification effect in western typography, which is already mentioned as the overall effect on the glyph shape when choosing fonts from a different region.
To make matters worse, there is no clear line drawn between (1) and (2). Indeed, (2) often leads on to (1) when divergence in character shapes is left unchecked.
Most of the problems to do with shapes come from the two Chinas, Hong Kong and Japan, as they have ended up with different results when attempting to do (3). Korea didn't change much from the old character shapes.
From early Qing-dynasty onward, before modern Chinese character standardisation efforts in the two Chinas, Japan, and Korea, there was only one reference print standard for the shapes. All printed Chinese characters, regardless of region, were based on shapes similar to those found in the Kangxi dictionary.

源流明體 - a cleaned-up, "modern" Song/Ming font based on old print forms.
Traditional Chinese calligraphy was always different from the old print forms, sometimes dramatically as seen in「令」- this had nothing to do with variant characters!

日新出號楷體 - regular script font based on the penmanship of a master calligraphist.
In making a set of reference character shapes for public use and educational purposes, Mainland China and Japan did more than just simplify - indeed, all regions diverged from the old character forms for different purposes, but a major purpose shared across all regions was to bring the print shape closer to the handwriting shape. Unfortunately, the set of handwriting features they decided to import into the print shape was different across the different regions.
Using the five characters 累令直漢刃 and the Noto Serif CJK fonts for comparison:

- Both Chinas decided to import handwritten「糸」into the printed form.
- Japan kept the old print form of「糸」.

「令」is made up of two components:
- 「亼」, an upside-down「口」(mouth);
- 「卩」, a kneeling person. The component form on the bottom looks like「ㄗ」.
- PRC replaced the old print form with the handwritten shape.
- ROC kept the old print form of「亼」while introducing the handwritten shape「龴」into the print form.
- Japan kept the old print form.

「直」was originally made up of an eye「目」and a straight vertical line「丨」:
Later on,「丨」changed into「十」, and「𠃊」was added.
The modern Chinese (PRC + ROC) handwritten form comes from a variant shape which omits the leftmost vertical stroke and merged「目」into the bottom horizontal line.
- The modern Chinese handwritten and print forms adopted this variant shape.
- The Japanese print form remained the same as the old print form and roughly the same as the traditional handwritten form.

- PRC and Japanese Kyūjitai forms are identical to the old print form.
- ROC print form adopted the bottom right hand stroke「丶」from the handwritten form, which detaches from the main body.
- Japanese Shinjitai form is based on a Japan-specific handwritten variation which reduced the top right hand「廿」shape into「艹」.

「刃」is a shape where the Kangxi form diverges from most traditional print forms. Most traditional print forms are identical to the handwritten form. The Kangxi form inherits a shape from the small seal script:
- PRC kept the old print/handwritten form form.
- ROC adopted the Kangxi form.
- Japan adopted a variant shape.