Looping through nested arrays with creating new array from nested items
You could indeed create a recursive function to collect each level of departments, keeping going as long as there are nested departments:

function indentDepartments(departments, model) {

    model.parentDepartments(doIndentDepartments(departments, 0));

    // called recursively to indent each level of department
    function doIndentDepartments(departments, level) {
        // indent departments at current level
        var departments = _.map(departments, function(department) {
            return buildDepartment(department, level);
        });

        // indent nested departments
        if (typeof departments.NestedDepartments != 'undefined') {
            departments.push.apply(departments, doIndentDepartments(departments.NestedDepartments, level +1));
        }

        return departments;
    }

    function buildDepartment(data, level) {
        department = _.pick(data, 'DepartmentUnitId', 'ParentDepartmentUnitId');
        name = _.times(level, function () { return '-'; }).join('') + data.Name;

        _.extend(department, { Name: name });
        return department;
    }
}