A man was shot and arrested in Tehran after trying to break into President Hassan Rouhani's office, the Fars news agency reported.