Yes, B12 injections are generally very safe when administered by a qualified healthcare provider
For example, a 2019 study of over 9,000 adults found people with obesity had lower blood levels of vitamin B12 (8)

Vitamin B12 shot may be prescribed to prevent or treat the following: Pernicious anemia (a condition in which there are low red blood cell counts due to an abnormality in B12 absorption by the intestines) Megaloblastic anemia (a type of anemia in which there are very large red blood cells called megaloblasts) Cognitive disorders, such as dementia (a disorder characterized by problems with memory, problem-solving abilities, language, etc.) Disorders that affect B12 absorption, such as pancreatic diseases, intestinal infections, Crohns disease, and tropical sprue Cardiovascular disease risk (by lowering blood homocysteine levels, which is a compound associated with an increased risk of heart problems) Multiple sclerosis symptoms Bells palsy recovery B12 deficiencies related to: Weight loss Vegan or restrictive diets Surgery to remove the part of the stomach or the ileum (the last part of the small intestine) Energy and endurance What are signs of vitamin B12 deficiency

In a cervical cancer cell line (HeLa), the compound reduced cell proliferation in a concentration- and time-dependent way and lowered expression of phospho-Akt and SIRT1, two proteins tied to tumor progression, while a non-cancer reference cell line was less affected
What is your injection preference