Basically yes. Just make sure that you have a full version of Windows, not an "upgrade". Also, with Win XP you will need SP2. Don't know about Vista as I've not used it yet...
And you cannot use OEM versions of Windows such as what might be shipped with a Dell computer. Such versions are licensed to run only on the specific hardware with which they were bundled.