I'm not sure what you want, but you can pass table name in this way:
ALTER PROCEDURE ...
@dbname NVARCHAR(30)
@tablename NVARCHAR(30)
AS
BEGIN
DECLARE @sql NVARCHAR(200)
SET @sql = 'SELECT * FROM [' @dbname + '].[dbo].[' + @tablename + ']'
EXEC(@sql)
END