There are regulations about what people involved in construction have to wear while they're working. It's not the contractee's sole discretion in that case. But if you're an independent building contractor and you want to come to work in sequined coveralls then sure?
A software contractor can indeed work in whatever they want, but the contract may stipulate some things about that and not doing so would be breach of contract. Obviously a contractor is bound to the terms of their contract.
In this case the analogy is the contractor using their own computer and software to manage their work process, not terms of what the work product is.
Likewise, if they're not an employee and their contract doesn't stipulate anything about behaviour on site than I would expect them to follow the law rather than policies they never agreed to... Is everyone entering a workplace subject to HR rules they've never even seen?
For reference, the things that I was vaguely referring to are described in detail here: http://www.cra-arc.gc.ca/E/pub/tg/rc4110/rc4110-e.html#facto...