Currently, Fox 36, Fox 38 and Fox 40 forks all use 32mm socket (6 point) to remove the forks top cap. It's best to get a low-profile socket that is flush, and chamfer-less, sitting flush against your top cap to maximize the contact points and provide a secure fit, reducing the chance of damaging your top cap. The 26mm socket fits 32-series forks, 28mm fits 34-series forks, and the 32mm socket size is for 36, 38 and 40-series forks. Fox may change these sizes, so be sure to take a ruler and measure your own Fox forks top cap socket length so you order the correct size.
Fox makes their own FOX Fork Topcap Socket: 32mm, 3/8 Drive
Park Tool also makes Flat-Faced Sockets in various sizes (24, 26, 27, 28, 30, 32mm), buy individually here: Park Tool Flat-Faced Socket 32mm, 3/8 Drive or get the full Park Tool SKT-6 Flat-Faced Socket Set
To install the top cap to the proper torque specs, you may also want a Park Tool torque wrench