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.
 A: 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).
A: I think you could keep the 11th draw. I am not sure about how to prove it theoretically, but a small simulation example should be enough (I am using R):
set.seed(1986)

b = 100000 # Number of iterations.
suc1 = numeric(b) # Pre-allocating memory.

for (i in seq_len(b))
{
  assignment = rbinom(100, 1, 0.5) # Bernoulli experiment.
  suc1[i] = assignment[1] # Store treatment status of first unit.
}  

sum(suc1) / b # Probability that the first unit is treated across b Bernoulli experiments.

This shows that by repeating the coin toss, we still are ensuring that each unit hat 50% chance of being treated (you can check by running the code for a different unit). So, I feel that you could keep the 11th assignment, and perform your analysis.
That being said, I really suggest to rely on a completely randomize trial, where you fix ex-ante the number of units to be treated $n_t$, and choose them simultaneously. Choosing $n_t = n/2$ ensures that the probability of being treated is 0.5. In this way, you lose the independence property of the Bernoulli trial, but you can control for the number of treated units, thus avoiding extreme cases where you have zero or too few units in a given treatment arm.
