Can one perform Bernoulli trial by restarting trial if everyone is assigned control or treatment? Suppose I have $n$ patient. I want to give an assignment of treatment such that probability of patients receiving treatment is $0.5$. Say I have $n$ unbiased coins to determine treatment or control status with $H=treatment$. In causal inference, I would like to compare treated outcome and untreated outcome. Suppose I toss $n$ unbiased coins with all heads. This is very bad as we do not obtain any information for control case.
Suppose I have tried 10 times and find out all heads. Hence, I cannot infer causality from previous 10 assignments. Thus those assignments have to be discarded. At the 11th time, I obtained some heads and tails.
Should I discard the design or should I keep 11th assignment generated? Of course, I could run the same argument for biased coin to favor patients receiving treatments.

Yes, you can re-randomize if for whatever reason your randomization is not successful. This is called re-randomization. Asymptotic theory is developed by  Li, Ding, and Rubin (2018) and an introduction is presented in Morgan and Rubin (2015). Typically this is done with the intention of balancing covariates better rather than balancing the sample sizes.
With a study of $n$ units, the probability that all $n$ will be in a single treatment group is $2^{1-n}$. For a sample of 10, this is less than 2 in a thousand; for a sample of 20, this is less than 2 in a million, making this an issue of little concern in applied research.
An alternative is to use random allocation where you have $n/2$ balls of two colors each and draw them from an urn without replacement, in which case you will still have random assignment with a treatment probability of .5 but you can guarantee balanced samples. This does induce dependence among the units, but as long as their order is randomized, it doesn't matter. Asymptotic theory may differ for this type of design, though (and I don't know enough about that to comment).
