This is actually two separate questions.
1) You cannot restore a database that is part of a database mirroring pair or availability group. If you try to do so, you will receive an error like this:
Msg 3104, Level 16, State 1, Line 2
RESTORE cannot operate on database 'AdventureWorks2012' because it is configured for database mirroring or has joined an availability group. If you intend to restore the database, use ALTER DATABASE to remove mirroring or to remove the database from its availability group.
Msg 3013, Level 16, State 1, Line 2
RESTORE DATABASE is terminating abnormally.
2) Any changes made to the primary database in an Availability Group WILL be sync'd to the other replicas. This includes DML and DDL changes. However, when doing an SSDT deploy, there are mechanisms to check for possible data loss in the target and prevent the deploy (those settings can be disabled). Essentially, deploying with SSDT to the primary would be like deploying to all of the replicas as well.
Also, certain operations are not allowed on databases that are members of a database mirroring pair or Availability Group (such as database restores, enabling service broker, etc.), so if your SSDT deploy tries to do one of those things, it will cause an error like this:
Msg 1468, Level 16, State 1, Line 1
The operation cannot be performed on database "AdventureWorks2012" because it is involved in a database mirroring session or an availability group. Some operations are not allowed on a database that is participating in a database mirroring session or in an availability group.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.