Can I connect an indoor water meter to water heater with PEX?
IMO I would use something more robust like copper, galvanized, or brass from the meter to the shut off if exposed at all.  Then use PEX after the shutoff.

Just know PEX is not designed to be left exposed to UV light like the sun or physical abuse of any kind.  If receives much of either, I would use another material or get it covered up.

On that note, we see PEX all the time on both sides of a shutoff and you  probably (not entirely sure of your circumstances) can use PEX from your meter to your shutoff without any problems.