Yes you can.
SQL provides statements to create new databases and database objects. You can execute these statements from your program to create databases programmatically.
Below article, you can see how to create a new SQL Server database and its objects such as table, stored procedures, views and add and view data. you also can see how to change database table schema programmatically. You'll see how SQL statement ALTER TABLE is useful when you need to change a database table schema programmatically.
Create a SQL Server Database dynamically in C#
I hope this will help to you.