Shotguns, yes. Less than 18", no.
Less than shotguns & rifles with barrels under 18" both had/have been used by the milary, police, government agents, etc. The blunderbus is one such form of a shotgun that was used by militaries. Sawed off shotguns were used during the civil war also.