Is this plastic pipe connecting city water to the main line dangerous?
Though it may seem odd, it is possible the plumber knows what he's talking about.  If this is a Polybutylene pipe, it could indeed be brittle and fail if it's jostled during the installation of the filter.
It's impossible to tell from the picture what type of pipe that is, but based on the plumbers concern I'd guess it is Polybutylene.
Polybutylene
Polybutylene was used in pipes between about 1980-1994/5, and was commonly used as supply line in the 80's.  It was found (in some cases) to react with oxidants in the water supply, which caused the pipe to become brittle and fail. To my knowledge, this type of piping is no longer used. Though if the house was built; or there was supply line work done, during the 80's, it's likely this is Polybutylene pipe.
High Density Polyethylene
Don't confuse Polybutylene pipe with Polyethylene pipe.  High-density polyethylene is commonly used as water supply line today, and is stable and safe to use.
Cross-linked polyethylene
Cross-linked polyethylene (PEX) is not typically used as an underground supply line, as it can sometimes react with minerals in the soil.  Where PEX is used underground, it's typically encased in sand (or other non-reactive materials) to prevent negative reactions. Because of this it's often more expensive to bury PEX, so other materials are used instead.
How can I tell what it is?
The only way to be sure what type of pipe this is, is to look for markings on the pipe itself.  Polybutylene will be marked PB####, Polyethylene will be marked PE####, Cross-linked polyethylene will be marked PEX-x (where x = A, B, or C).