The unit of work will process the work in groups, so all inserts, all updates, all deletes and you can define in which order these groups are executed. This means that for some inserts an update has to be performed first and for a certain update an insert has to be performed first (so a catch 22), then it can't be solved. The idea is that for updates to work, it's enough to first have all inserts done, because the inserts will provide the PK values that updates might need (you insert a new row with a PK of 4 and then an update which writes 4 for an FK field pointing to that PK side).
So if you first run all inserts, then all updates, it should be ok, however if you run into FK violations, please check what is happening: enable tracing to see which SQL queries are produced or use the ORM Profiler to see what's going on (free tool that comes with an active subscription).
The only thing I can think of which might go wrong if is you have a unique constraint and you want to place a new value in that UC through either insert or update it goes wrong because the row which already has that value is scheduled for delete after those actions. In that case run the deletes first.
You can specify the ordering in the Unit of work constructor