You can, but it is better and faster to make baked pasta dishes with precooked pasta. Using uncooked pasta will take much longer to cook until soft and will soak up every bit of moisture in the dish, resulting in a dryer recipe.