I submitted a short paper to a math journal more that one month ago. The status is still "awaiting assignment" and I checked the online system which shows that even no editor has been assigned to my paper. I sent two emails about updating the status of the paper to editor and Editor-in-Chief several days ago and I got no reply from them. What can I do now? May I withdraw that?
You can certainly withdraw the paper. But note that this is a busy time for academics, some of whom are the editors and certainly the reviewers. It might be good to wait, especially if the journal is somewhere that you really want to publish.
The one month is more problematic than the few days without email, I think. But that might be explained if your paper is a bit esoteric in any way and it may be unclear which editor to assign the paper to.
But withdrawal is a possibility. I'd recommend it only if you have an alternate plan that is better than patience.