There are some states in the US that do now allow dash cams. Dash cams are fully allowed with windshield mounting in Alaska, Colorado, Florida, Illinois, Maine, Massachusetts, Missouri, Michigan, Mississippi, New York, New Hampshire, North Carolina, Ohio, Tennessee, and Vermont.
Along with that, a handful of other states allow it with certain exceptions depending on the state including Arizona, California, Hawaii, Indiana, Maryland, Nevada, Utah, Wisconsin, and Washington DC. If you live in these states, check your particular state regulations to know the proper installation for your dash cam.
For all other states, dash cams themselves are not illegal but windshield mounting them is illegal. With that, you can choose to install your dash cam in the corner of your dashboard, not on the windshield, or find another way to mount it legally per your state’s regulations.