Yes, it will work. But a nano running on a battery is not a useful circuit by itself. To do anything useful you would normally have other components connected to the Nano. If these only draw small currents, it will work with the 9V battery, although not for long because of the low capacity. Components that need anything more than a small current will quickly show you the limitations of 9V batteries. In addition to the low capacity, they also have a high internal resistance. This means that when you draw anything more than a small current from them, the voltage will drop, possibly causing the Nano to become unstable or reset itself. But whatever current is drawn, almost half the battery's capacity will be wasted. The Vin pin connects to the nano's regulator. The regulator turns 9V into 5V by turning nearly half the power into waste heat.
A much better option is a holder for 4 x AA or AAA NiMH rechargeable cells. This can be connected directly to the 5V pin, bypassing that wasteful regulator and have a much higher capacity. DO NOT use 4 x non-rechargeable cells like that, the voltage will be too high and could damage the Nano. If you must use non-rechargeables for some reason, maybe a holder for 3 x AA or AAA.