Create a nuspec like the following:
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
  <metadata>
    <id>TestContentFile</id>
    <version>3.0.0</version>
    <authors>TestContentFile</authors>
    <owners>TestContentFile</owners>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <description>Package Description</description>
    <dependencies>
      <group targetFramework=".NETStandard2.0" />
    </dependencies>
    <contentFiles>
      <files include="any/netstandard2.0/RemoveMe/TestFile.txt" buildAction="content" flatten="true" copyToOutput="false"/>
    </contentFiles>
  </metadata>
  <files>
    <file src="contentFiles/any/netstandard2.0/RemoveMe/TestFile.txt" target="contentFiles/any/netstandard2.0/RemoveMe/TestFile.txt" />
  </files>
</package>
It packs properly, but the argument flatten="true" did not work as expected after install the packed packaged to the project. 
According to the description of flatten,
A Boolean indicating whether to copy content items to a single folder in the build output (true), or to preserve the folder structure in the package (false). The default is false.
And NuGet ContentFiles Demystified:
Should the files be all delivered to the root folder of the project or should they keep the folder structure that they were packaged in. The default value is false, which indicates they should create (if necessary) and keep the same structure they have after the TFM folder in the pacakge.
So if I set the flatten="true", after install this package to project, the TestFile.txt file should be delivered to the root folder of the project. Am I right? But after install this package to project, I still got the that file in the folder RemoveMe.
Besides, I also test other argument buildAction="content" copyToOutput="false", both of them works fine.
NuGet product used: NuGet.exe
NuGet version: 4.1.0
VS version (if appropriate): VS2017 15.4.4
OS version (i.e. win10 v1607 (14393.321)): Win 10 1703
Worked before? If so, with which NuGet version:
Create a .netstand project with VS2017, add a folder RemoveMe with a test file TestFile.txt in it.
set 
  <ItemGroup>
    <Content Include="RemoveMe\ContentFile.txt">
      <PackageFlatten>true</PackageFlatten>
    </Content>
  </ItemGroup>
Sample Project:
I share the onedrive link here, so that you can pack the .nuspec file directly:
@rohit21agrawal can you please take a look into this?
sounds like pack is doing the right thing (@liushuanggang can you paste the nuspec file generated in the nupkg here to verify?) ...this will be a restore bug (for triaging purposes)
@rohit21agrawal, Sorry later reply. I have pasted my nuspec file below. And I have provided my test sample with one driver:
https://1drv.ms/f/s!Ai1sp_yvodHfgQirLftPPOso7tV1
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
  <metadata>
    <id>TestContentFile</id>
    <version>3.0.0</version>
    <authors>TestContentFile</authors>
    <owners>TestContentFile</owners>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <description>Package Description</description>
    <dependencies>
      <group targetFramework=".NETStandard2.0" />
    </dependencies>
    <contentFiles>
      <files include="any/netstandard2.0/RemoveMe/TestFile.txt" buildAction="content" flatten="true" copyToOutput="false"/>
    </contentFiles>
  </metadata>
  <files>
    <file src="contentFiles/any/netstandard2.0/RemoveMe/TestFile.txt" target="contentFiles/any/netstandard2.0/RemoveMe/TestFile.txt" />
  </files>
</package>
                    seems like the <Link> metadata for the contentFile written out in the .g.props file (inside the obj folder) has the wrong value and does not respect the flatten property.
flatten flag only works when copyToOutput flag is set to true. I've updated the documentation to reflect the same.
Still does not work for me.
<contentFiles>
      <files include="any/net472/bin/Release/net472/config.json" buildAction="Content" copyToOutput="true" flatten="true" />
    </contentFiles>
                      <ItemGroup>
    <Content Include="native\*">
      <PackageCopyToOutput>true</PackageCopyToOutput>
      <PackageFlatten>true</PackageFlatten>
    </Content>
  </ItemGroup>
PackageFlatten works only if the consuming project is a .net Framework Project. If you use the new core format csproject Fille (sdk) the files are not flatten in the output directory.
Most helpful comment
Still does not work for me.