Can I run a defrag while using my computer?

Is it safe to run a full defrag while I am using my computer?

If so, does it just skip any files that I have open (locked)?

In a nutshell, Yes and Yes but I think probably best not to if you can.